You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
526 B
38 lines
526 B
1 year ago
|
# syntax=docker/dockerfile:1
|
||
|
|
||
|
##
|
||
|
## Build
|
||
|
##
|
||
|
FROM golang:1.18-alpine AS build
|
||
|
|
||
|
RUN apk update
|
||
|
RUN apk upgrade
|
||
|
RUN apk add build-base git
|
||
|
|
||
|
WORKDIR /app
|
||
|
|
||
|
COPY ./ ./
|
||
|
|
||
|
RUN go mod tidy
|
||
|
RUN mkdir bin
|
||
|
|
||
|
WORKDIR /app/dvzaservice
|
||
|
|
||
|
RUN go build -o /app/bin/dvza
|
||
|
|
||
|
##
|
||
|
## Deploy
|
||
|
##
|
||
|
FROM golang:1.18-alpine
|
||
|
|
||
|
WORKDIR /
|
||
|
|
||
|
COPY ./dvzaservice/assets /assets
|
||
|
COPY ./dvzaservice/templates /templates
|
||
|
COPY --from=build /app/bin/dvza ./dvza
|
||
|
|
||
|
RUN adduser -D nonroot
|
||
|
USER nonroot:nonroot
|
||
|
|
||
|
# > "logs/$(date +'%Y%m%d_%H%M').log" 2>&1
|
||
|
ENTRYPOINT ["/dvza"]
|