diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d4749c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:latest AS builder + +WORKDIR /app + +COPY . . + +RUN go mod download + +RUN go build -o httpserver ./cmd/httpserver/main.go + +EXPOSE 8080 + +ENTRYPOINT [ "/app/httpserver" ] \ No newline at end of file diff --git a/Dockerfile.http b/Dockerfile.http deleted file mode 100644 index ac7e4de..0000000 --- a/Dockerfile.http +++ /dev/null @@ -1,20 +0,0 @@ -# Specifies a parent image -FROM golang:1.19.2-bullseye - -# Creates an app directory to hold your app’s source code -WORKDIR /app - -# Copies everything from your root directory into /app -COPY . . - -# Installs Go dependencies -RUN go mod tidy - -# Builds your app with optional configuration -RUN go build -o httpserver ./cmd/httpserver/main.go - -# Tells Docker which network port your container listens on -EXPOSE 8080 - -# Specifies the executable command that runs when the container starts -CMD [ “/httpserver ] \ No newline at end of file diff --git a/go.mod b/go.mod index 9f313d2..0f162f8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/codescalersinternships/Datetime-server-RawanMostafa -go 1.23.1 +go 1.23 require ( github.com/bytedance/sonic v1.12.2 // indirect