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
haraldnilsen 6f1db8b64a 🐳 updated Dockerfile for folder structure
Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
2024-01-13 12:00:42 +01:00

18 lines
389 B
Docker

# Start from the latest golang base image
FROM golang:latest
# Set the Current Working Directory inside the container
WORKDIR /app
# Copy everything from the current directory to the PWD inside the container
COPY go.* .
# Download all the dependencies
RUN go mod download && go mod verify
COPY ./cmd ./cmd
RUN go build -v -o main ./cmd
# Command to run the executable
CMD ["./main"]