This repository has been archived on 2024-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
helseveileder/backend/Dockerfile

27 lines
660 B
Docker
Raw Normal View History

2024-01-12 20:33:20 +00:00
# syntax=docker/dockerfile:1
2024-01-12 20:52:46 +00:00
FROM golang:latest
2024-01-12 20:33:20 +00:00
# Set destination for COPY
2024-01-12 20:52:46 +00:00
WORKDIR /app
2024-01-12 20:33:20 +00:00
# Download Go modules
COPY go.mod go.sum ./
RUN go mod download
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY *.go ./
# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o /docker-gs-ping
# 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 8080
# Run
CMD ["/docker-gs-ping"]