kleinTodo/server/Dockerfile

23 lines
494 B
Docker
Raw Normal View History

2025-07-26 23:31:00 +02:00
# Use an official Golang runtime as a parent image
FROM golang:latest as build
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY go.mod .
COPY go.sum .
# Download and install any required dependencies
RUN go mod download
2025-08-23 13:28:48 +02:00
COPY .. .
2025-07-26 23:31:00 +02:00
# Build the Go app
RUN go build .
FROM gcr.io/distroless/base-debian12
COPY --from=build /app/kleinTodo .
# Define the command to run the app when the container starts
CMD ["./kleinTodo"]