All checks were successful
build and deploy kleinTodo / build (push) Successful in 34s
Updated delete logic Added last modified and deleted to the todo item
25 lines
565 B
Docker
25 lines
565 B
Docker
# 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 server/go.mod .
|
|
COPY server/go.sum .
|
|
# Download and install any required dependencies
|
|
RUN go mod download
|
|
|
|
COPY .. .
|
|
|
|
# Build the Go app
|
|
RUN go build -o serverBinary ./server/
|
|
|
|
FROM gcr.io/distroless/base-debian12
|
|
|
|
COPY --from=build /app/serverBinary .
|
|
|
|
ENV XDG_CONFIG_HOME=/data
|
|
|
|
# Define the command to run the app when the container starts
|
|
CMD ["./serverBinary"]
|