initial commit
This commit is contained in:
22
{{cookiecutter.project_slug}}/Dockerfile
Normal file
22
{{cookiecutter.project_slug}}/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM --platform=$BUILDPLATFORM golang:1.21-alpine as build
|
||||
|
||||
ADD . /app
|
||||
WORKDIR /app
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETOS
|
||||
|
||||
RUN apk add --no-cache make
|
||||
RUN make build BUILD_ARCH="$TARGETARCH" BUILD_OS="$TARGETOS"
|
||||
|
||||
FROM --platform=$TARGETPLATFORM alpine:latest
|
||||
|
||||
RUN apk add --no-cache make ca-certificates
|
||||
|
||||
WORKDIR /data
|
||||
COPY --from=build /app/build/{{cookiecutter.project_slug}} /app/{{cookiecutter.project_slug}}
|
||||
|
||||
EXPOSE 3000
|
||||
VOLUME [ "/data" ]
|
||||
|
||||
CMD [ "/app/{{cookiecutter.project_slug}}" ]
|
||||
Reference in New Issue
Block a user