This commit is contained in:
2023-04-08 14:46:35 -05:00
parent 632ac27624
commit 8351c16bbd
7 changed files with 502 additions and 1 deletions

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# Use golang:1.17 as the base image
FROM golang:1.20
ENV GOPATH /go
ENV PATH $PATH:$GOPATH/bin
# Set the working directory inside the container
WORKDIR /app
# Copy the Go project files into the container
COPY . .
# Run swag init to generate Swagger documentation
RUN go install && go install github.com/swaggo/swag/cmd/swag@latest && swag init
# Build the Go application inside the container
RUN go build -o main .
# Expose the port the application listens on
EXPOSE 8080
# Run the application
CMD ["./main"]