Skip to content

Commit

Permalink
Merge pull request #31 from grisu48/tiny
Browse files Browse the repository at this point in the history
Make tiny containers
  • Loading branch information
grisu48 authored Jun 18, 2021
2 parents 65cac0d + 8d4e9eb commit 0bf6ad0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM golang:buster AS build-env
ARG ARCH=

FROM ${ARCH}golang:buster AS build-env
WORKDIR /app
ADD . /app
RUN apt-get update && apt-get upgrade -y
RUN cd /app && make requirements && make -B pastad
#RUN apt-get update && apt-get upgrade -y
RUN cd /app && make requirements && make pastad-static

FROM debian:buster
RUN apt-get update && apt-get upgrade -y
RUN mkdir /app
RUN mkdir /data
FROM scratch
#RUN mkdir /app
#RUN mkdir /data
WORKDIR /data
COPY --from=build-env /app/pastad /app/pastad
COPY --from=build-env /app/mime.types /app/mime.types
ENTRYPOINT /app/pastad -m /app/mime.types -c /data/pastad.toml
ENTRYPOINT ["/app/pastad", "-m", "/app/mime.types", "-c", "/data/pastad.toml"]
VOLUME ["/data"]
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pasta: cmd/pasta/pasta.go cmd/pasta/storage.go
go build $^
pastad: cmd/pastad/pastad.go cmd/pastad/storage.go
go build $^
pastad-static: cmd/pastad/pastad.go cmd/pastad/storage.go
CGO_ENABLED=0 go build -ldflags="-w -s" -o pastad $^

test: pastad pasta
go test ./...
Expand Down

0 comments on commit 0bf6ad0

Please sign in to comment.