mirror of
https://github.com/cooperspencer/gickup
synced 2024-11-08 12:09:18 +01:00
CMD to ENTRYPOINT in docker (#85)
Fix for the Dockerfile using CMD. ENTRYPOINT is nicer. Signed-off-by: Phil <phil@ucode.space>
This commit is contained in:
parent
d52d7cc8be
commit
af10e4690d
13
Dockerfile
13
Dockerfile
@ -1,16 +1,25 @@
|
||||
FROM golang:alpine as builder
|
||||
|
||||
# Install dependencies for copy
|
||||
RUN apk add -U --no-cache ca-certificates tzdata
|
||||
|
||||
# Use an valid GOPATH and copy the files
|
||||
WORKDIR /go/src/github.com/cooperspencer/gickup
|
||||
COPY . .
|
||||
|
||||
# Fetching dependencies and build the app
|
||||
RUN go get -d -v ./...
|
||||
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o app .
|
||||
|
||||
# Use scratch as production environment -> Small builds
|
||||
FROM scratch as production
|
||||
WORKDIR /
|
||||
# Copy valid SSL certs from the builder for fetching github/gitlab/...
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=builder /go/src/github.com/cooperspencer/gickup/app /gickup/app
|
||||
# Copy zoneinfo for getting the right cron timezone
|
||||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
||||
CMD ["./gickup/app"]
|
||||
# Copy the main executable from the builder
|
||||
COPY --from=builder /go/src/github.com/cooperspencer/gickup/app /gickup/app
|
||||
|
||||
ENTRYPOINT [ "/gickup/app" ]
|
||||
CMD [ "/gickup/conf.yml" ]
|
||||
|
@ -4,5 +4,5 @@ services:
|
||||
# build: . # If you want to Build the Image locally (You need the complete Repo on your PC)
|
||||
image: buddyspencer/gickup:latest
|
||||
volumes:
|
||||
- ${PWD}/conf.yml:/gickup/conf.yml
|
||||
command: ["./gickup/app", "/gickup/conf.yml"]
|
||||
- ${PWD}/conf.yml:/gickup/conf.yml # Change the path of your local config ${PWD} is your current directory (where the docker-compose.yml is located)
|
||||
command: ["/gickup/conf.yml"] # Changes the path of the internal bound config
|
||||
|
Loading…
Reference in New Issue
Block a user