boxes-api/Dockerfile

22 lines
379 B
Docker
Raw Normal View History

2024-10-05 01:10:35 +00:00
FROM golang:1.21-alpine AS builder
WORKDIR /app
# Copy the source code
COPY . .
# Build the Go application
RUN go mod tidy
RUN go build -o main .
# Mount the data directory
VOLUME /app/data
# Copy config.yaml from the application directory
COPY config.yaml /app/
# Expose the port your application listens on
EXPOSE 8080
# Command to run your application
CMD ["/app/main"]