dockerized the app

This commit is contained in:
Nabil Ould Hamou 2024-02-27 07:41:43 +01:00
parent 85c13896b2
commit 9d947e1e37
No known key found for this signature in database
GPG key ID: 2B1AE73E9B6014EF
3 changed files with 36 additions and 0 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
/assets/
/assets/*
.env

15
Dockerfile Normal file
View file

@ -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"]

18
docker-compose.yml Normal file
View file

@ -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: