update publish.yml and Dockerfile
This commit is contained in:
parent
c759587f22
commit
df7f6709cc
|
@ -39,8 +39,10 @@ jobs:
|
|||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
build-args: |
|
||||
VERSION=v${{ steps.get_version.outputs.VERSION }}
|
||||
tags: |
|
||||
${{ secrets.REGISTRY_NAME }}/zdam-egzamin-zawodowy-backend:latest
|
||||
${{ secrets.REGISTRY_NAME }}/zdam-egzamin-zawodowy-backend:${{ steps.get_version.outputs.VERSION }}
|
||||
file: ./build/server/Dockerfile
|
||||
push: true
|
||||
push: true
|
||||
|
|
|
@ -11,9 +11,10 @@ RUN go mod download
|
|||
|
||||
# Copy the source from the current directory to the Working Directory inside the container
|
||||
COPY ../.. .
|
||||
ARG VERSION="v0.0.0"
|
||||
RUN apk --no-cache add musl-dev gcc build-base
|
||||
RUN go generate ./...
|
||||
RUN go build -o zdamegzawodowy ./cmd/server
|
||||
RUN go build -ldflags="-X 'main.Version=$VERSION'" -o zdamegzawodowy ./cmd/server
|
||||
|
||||
######## Start a new stage from scratch #######
|
||||
FROM alpine:latest
|
||||
|
@ -28,4 +29,4 @@ COPY --from=builder /app/zdamegzawodowy .
|
|||
ENV APP_MODE=production
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ./wait && ./zdamegzawodowy
|
||||
CMD ./zdamegzawodowy
|
||||
|
|
Reference in New Issue