adding self-hosting capabilities

This commit is contained in:
Violet
2024-11-10 10:03:59 -07:00
parent 7b9fbf8976
commit 005bb9c7b7
5 changed files with 232 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# Use a lightweight, official Go image as the base
FROM golang:1.21-alpine AS builder
# Set the working directory inside the image
WORKDIR /app
# Copy the source code to the working directory
COPY . .
# Build the Go application
RUN go build -o main .
# Create a new stage for the production image
FROM alpine:latest
# Copy the built binary from the builder stage
COPY --from=builder /app/main /app/
# Set the working directory
WORKDIR /app
# Expose the port the application will listen on
EXPOSE 8888
# Define the command to run the application
CMD ["./main"]