go-location-logger/Dockerfile

23 lines
606 B
Docker
Raw Permalink Normal View History

2023-11-23 15:42:07 +01:00
# Use an official Golang runtime as a parent image
FROM golang:1.21.4
# Set the working directory in the container
WORKDIR /go/src/app
# Copy the local package files to the container's workspace
COPY ../../Downloads .
# Download and install any required third-party dependencies into the container.
#RUN go get -u github.com/gorilla/mux
RUN go get -u github.com/go-sql-driver/mysql
RUN go get -u github.com/sirupsen/logrus
# Build the Go application
RUN go build -o main .
# Expose port 8080 to the outside world
EXPOSE 8080
# Command to run the application with environment variables
CMD ["./main"]