🐳 Created Dockerfile

This commit is contained in:
Maxim Lebedev 2023-11-08 02:06:21 +06:00
parent b16891cbad
commit 2d4e7468be
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 27 additions and 0 deletions

27
build/Dockerfile Normal file
View File

@ -0,0 +1,27 @@
# syntax=docker/dockerfile:1
# docker build --rm -f build/Dockerfile -t source.toby3d.me/toby3d/home .
# Build
FROM golang:alpine AS builder
WORKDIR /app
ENV CGO_ENABLED=0
ENV GOFLAGS="-mod=vendor -buildvcs=true"
COPY go.mod go.sum *.go ./
COPY internal ./internal/
COPY vendor ./vendor/
RUN go build -o ./home
# Run
FROM scratch
WORKDIR /
COPY --from=builder /app/home /home
EXPOSE 3000
ENTRYPOINT ["/home"]