From 871b7ee32a87b50684de6362ae0d80a6788821bb Mon Sep 17 00:00:00 2001 From: Suresh Peiris Date: Wed, 1 Nov 2023 00:33:51 +0530 Subject: [PATCH] Create Dockerfile --- Dockerfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c414dc6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Use an official Go runtime as a parent image +FROM golang:1.16-alpine3.14 + +# Set the working directory to /app +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app + +# Build the Go application +RUN go build -o main . + +# Expose port 8080 to the outside world +EXPOSE 8080 + +# Run the Go application when the container starts +CMD ["/app/main"]