awesome-compose/react-rust-postgres/docker-compose.yaml
Jérémie Drouet b73e252639 react-rust-postgres: add connection to postgres with migrations
Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
2020-03-26 10:39:45 +01:00

44 lines
851 B
YAML

version: "3.7"
services:
frontend:
build:
context: frontend
target: development
networks:
- client-side
ports:
- 3000:3000
volumes:
- ./frontend/src:/code/src:ro
backend:
build:
context: backend
target: development
environment:
- DATABASE_URL=postgres://postgres:mysecretpassword@db/postgres
networks:
- client-side
- server-side
volumes:
- ./backend/src:/code/src
- backend-cache:/code/target
depends_on:
- db
db:
image: postgres:12-alpine
restart: always
environment:
- POSTGRES_PASSWORD=mysecretpassword
networks:
- server-side
ports:
- 5432:5432
volumes:
- db-data:/var/lib/postgresql/data
networks:
client-side: {}
server-side: {}
volumes:
backend-cache: {}
db-data: {}