Skip to content

Commit

Permalink
add postgres to docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay288 committed Aug 7, 2022
1 parent 09ae754 commit 9e02b81
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions deploy/db/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE DATABASE metlo_api_security;
17 changes: 15 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
version: "3.9"

services:
db:
image: postgres:14.4-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- db:/var/lib/postgresql/data
- ./deploy/db/init.sql:/docker-entrypoint-initdb.d/init_db.sql
backend:
image: metlo/backend
container_name: metlo-backend
restart: unless-stopped
environment:
- DB_URL=${DB_URL}
- DB_URL=postgres://postgres:postgres@db:5432/metlo_api_security
frontend:
image: metlo/frontend
container_name: metlo-frontend
restart: unless-stopped
ports:
- 8000:3000
- 8000:3000

volumes:
db:
driver: local

0 comments on commit 9e02b81

Please sign in to comment.