Skip to content

Commit bfbb7c5

Browse files
committed
fix docker-compose, dockerignore
1 parent b572d74 commit bfbb7c5

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
services:
2+
db:
3+
image: postgres:18.1
4+
volumes:
5+
- postgres_data:/var/lib/postgresql/data/
6+
environment:
7+
POSTGRES_DB: ${DB_NAME}
8+
POSTGRES_USER: ${DB_USER}
9+
POSTGRES_PASSWORD: ${DB_PASSWORD}
10+
PGDATA: /var/lib/postgresql/data/pg18
11+
ports:
12+
- "5432:5432"
13+
healthcheck:
14+
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
15+
interval: 5s
16+
timeout: 5s
17+
retries: 5
18+
19+
backend:
20+
build: ./backend
21+
command: bash -c "python /app/seed.py && uvicorn app.main:app --host 0.0.0.0 --port 8000"
22+
volumes:
23+
- ./backend:/app
24+
ports:
25+
- "8000:8000"
26+
environment:
27+
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME}
28+
SECRET_KEY: ${SECRET_KEY}
29+
depends_on:
30+
db:
31+
condition: service_healthy
32+
33+
frontend:
34+
build: ./frontend
35+
ports:
36+
- "3000:3000"
37+
volumes:
38+
- ./frontend:/app
39+
- /app/node_modules
40+
depends_on:
41+
- backend
42+
43+
volumes:
44+
postgres_data:

frontend/.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Docker
2+
.dockerignore
3+
Dockerfile
4+
5+
# Git
6+
.git
7+
.gitignore
8+
9+
# Runtime
10+
node_modules
11+
build
12+
dist
13+
.env
14+
.env*.local
15+
16+
# Logs
17+
npm-debug.log*
18+
yarn-debug.log*
19+
yarn-error.log*
20+
21+
# IDEs
22+
.idea
23+
.vscode
24+
*.swp

0 commit comments

Comments
 (0)