From 9d947e1e3759d73c89a697dd587b4c6f811e410f Mon Sep 17 00:00:00 2001 From: Nabil Ould Hamou Date: Tue, 27 Feb 2024 07:41:43 +0100 Subject: [PATCH] dockerized the app --- .dockerignore | 3 +++ Dockerfile | 15 +++++++++++++++ docker-compose.yml | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c308c3b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/assets/ +/assets/* +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e47d4dd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:latest + +WORKDIR /app + +COPY go.mod go.sum ./ + +RUN go mod download + +COPY . . + +RUN go build -o azote . + +EXPOSE 8080 + +CMD ["./azote"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b95c4b5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3.8" +services: + app: + image: ouldhamounabil/azote-backend + build: + context: . + dockerfile: Dockerfile + ports: + - "8080:8080" + environment: + DSN: "${DSN}" + JWT_SECRET: "${JWT_SECRET}" + GIN_MODE: "${GIN_MODE}" + volumes: + - assets:/app/assets + +volumes: + assets: \ No newline at end of file