Skip to content

Commit

Permalink
Improve Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hgw8 committed Dec 10, 2023
1 parent a1e18fa commit 579a2ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM golang:1.21-alpine
WORKDIR /app
FROM golang:1.21-alpine as builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -o hardfiles main.go

FROM golang:1.21-alpine as app
WORKDIR /app
COPY --from=builder /build/hardfiles .
RUN mkdir files
CMD ["./hardfiles"]
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ services:
hardfiles:
container_name: hardfiles
image: git.supernets.org/supernets/hardfiles:latest
build: .
volumes:
- "$PWD/files:/app/files"
- "$PWD/www:/app/www"
Expand Down

0 comments on commit 579a2ac

Please sign in to comment.