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

19 lines
389 B
Docker
Raw Permalink Normal View History

2024-01-12 21:01:59 +00:00
# Start from the latest golang base image
FROM golang:latest
2024-01-12 20:33:20 +00:00
2024-01-12 21:01:59 +00:00
# Set the Current Working Directory inside the container
2024-01-12 20:52:46 +00:00
WORKDIR /app
2024-01-12 20:33:20 +00:00
2024-01-12 21:01:59 +00:00
# Copy everything from the current directory to the PWD inside the container
COPY go.* .
2024-01-12 20:33:20 +00:00
2024-01-12 21:01:59 +00:00
# Download all the dependencies
RUN go mod download && go mod verify
2024-01-12 20:33:20 +00:00
COPY ./cmd ./cmd
2024-01-12 21:30:39 +00:00
RUN go build -v -o main ./cmd
2024-01-12 20:33:20 +00:00
2024-01-12 21:01:59 +00:00
# Command to run the executable
CMD ["./main"]