add docker compose setup

This commit is contained in:
Waylon Walker 2023-06-02 15:52:12 -05:00
parent 19ea3a3e7d
commit 0d205ebd5e
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
3 changed files with 111 additions and 0 deletions

40
docker-compose.yml Normal file
View file

@ -0,0 +1,40 @@
version: "3.8"
services:
db:
image: postgres:14.1-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
volumes:
- db:/var/lib/postgresql/data
api:
build:
dockerfile: Dockerfile
tags:
- "learn-sql-model"
image: learn-sql-model
restart: always
ports:
- "5000:5000"
depends_on:
- db
volumes:
- ./:/app
cli:
build:
dockerfile: Dockerfile.dev
tags:
- "learn-sql-model-dev"
image: learn-sql-model-dev
depends_on:
- db
- api
restart: always
tty: true
stdin_open: true
volumes:
db:
driver: local