Skip to content

Commit

Permalink
(chore) update docker compose with redis
Browse files Browse the repository at this point in the history
  • Loading branch information
AHarmlessPyro committed Aug 30, 2022
1 parent 86d6409 commit 83eba54
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
21 changes: 16 additions & 5 deletions docker-compose-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,31 @@ services:
- db:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init_db.sql
ports:
# WARNING : DB **SHOULD NEVER** BE EXPOSED IN THE PROD INSTANCE. Be careful when using the local docker compose.
- 5432:5432
# WARNING : DB **SHOULD NEVER** BE EXPOSED IN THE PROD INSTANCE. Be careful when using the local docker compose.
- 5431:5432
cache:
image: redis:7.0.4
restart: always
command: redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
volumes:
- cache:/data
backend:
build:
context: ./
dockerfile: ./deploy/backend/Dockerfile
# image: metlo/backend
container_name: metlo-backend
depends_on:
- cache
restart: unless-stopped
ports:
- 8080:8080
environment:
- DB_URL=postgres://postgres:postgres@db:5432/metlo_api_security
#- ENCRYPTION_KEY=
#- BACKEND_URL=
#- EXPRESS_SECRET=
- REDIS_URL=redis://:eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81@cache:6379
- ENCRYPTION_KEY
- BACKEND_URL
- EXPRESS_SECRET
jobs:
image: metlo/jobrunner
container_name: metlo-jobs
Expand All @@ -48,3 +57,5 @@ services:
volumes:
db:
driver: local
cache:
driver: local
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,23 @@ services:
volumes:
- db:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init_db.sql
cache:
image: redis:7.0.4
restart: always
command: redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
volumes:
- cache:/data
backend:
image: metlo/backend
container_name: metlo-backend
restart: unless-stopped
depends_on:
- cache
ports:
- 8080:8080
environment:
- DB_URL=postgres://postgres:postgres@db:5432/metlo_api_security
- REDIS_URL=redis://:eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81@cache:6379
#- ENCRYPTION_KEY=
#- BACKEND_URL=
#- EXPRESS_SECRET=
Expand All @@ -39,3 +48,5 @@ services:
volumes:
db:
driver: local
cache:
driver: local

0 comments on commit 83eba54

Please sign in to comment.