22 lines
379 B
Docker
22 lines
379 B
Docker
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"] |