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