feat(docker): add Dockerfile

This commit is contained in:
hgc 2023-06-07 12:51:59 +00:00
rodič 32f6054941
revize 39336b5aa6

22
Dockerfile Normal file
Zobrazit soubor

@ -0,0 +1,22 @@
FROM golang:1.20
# Set destination for COPY
WORKDIR /app
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY . ./
# Build
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux go build -o /filehole
# Optional:
# To bind to a TCP port, runtime parameters must be supplied to the docker command.
# But we can document in the Dockerfile what ports
# the application is going to listen on by default.
# https://docs.docker.com/engine/reference/builder/#expose
EXPOSE 8000
# Run
CMD ["/filehole", "serve"]