Initialize project with basic endpoints.

This commit is contained in:
Ben Binder
2025-02-23 20:00:29 -06:00
commit e68b88bcb7
5 changed files with 171 additions and 0 deletions

32
Dockerfile Normal file
View File

@@ -0,0 +1,32 @@
# Use a small Go base image
FROM golang:1.22 as builder
# Set working directory
WORKDIR /app
# Copy go mod and sum files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy the rest of the application
COPY . .
# Build the application
RUN go build -o your-app-name .
# Use a small base image for the final container
FROM alpine:latest
# Set working directory
WORKDIR /root/
# Copy the compiled binary from the builder stage
COPY --from=builder /app/your-app-name .
# Expose the port the app runs on
EXPOSE 8080
# Run the binary
CMD ["./your-app-name"]