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
498 B
38 lines
498 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/his
|
||
|
|
||
|
RUN go build -o /app/bin/his
|
||
|
|
||
|
##
|
||
|
## Deploy
|
||
|
##
|
||
|
FROM golang:1.18-alpine
|
||
|
|
||
|
WORKDIR /
|
||
|
|
||
|
COPY ./his/assets /assets
|
||
|
COPY ./his/templates /templates
|
||
|
COPY --from=build /app/bin/his ./his
|
||
|
|
||
|
RUN adduser -D nonroot
|
||
|
USER nonroot:nonroot
|
||
|
|
||
|
# > "logs/$(date +'%Y%m%d_%H%M').log" 2>&1
|
||
|
ENTRYPOINT ["/his"]
|