2024-02-13 18:45:08 +01:00
|
|
|
# Use an official Golang runtime as a parent image
|
|
|
|
|
FROM golang:latest
|
|
|
|
|
|
|
|
|
|
# Set the working directory to /app
|
|
|
|
|
WORKDIR .
|
|
|
|
|
# Copy the current directory contents into the container at /app
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Download and install any required dependencies
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
|
|
# Build the Go app
|
2024-02-13 18:57:05 +01:00
|
|
|
RUN go build .
|
2024-02-13 18:45:08 +01:00
|
|
|
|
2024-02-14 12:39:10 +01:00
|
|
|
# Generate orm
|
2024-02-14 14:55:41 +01:00
|
|
|
RUN go generate ./database/ent
|
2024-02-14 12:39:10 +01:00
|
|
|
|
2024-02-13 18:45:08 +01:00
|
|
|
# Expose port 8080 for incoming traffic
|
|
|
|
|
EXPOSE 4002
|
|
|
|
|
|
|
|
|
|
# Define the command to run the app when the container starts
|
2024-03-14 21:35:55 +01:00
|
|
|
CMD ["./portfolio"]
|