Skip to content

Commit 6768a53

Browse files
committed
all-in-one docker-compose file
1 parent a6cc5b6 commit 6768a53

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docker-compose.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: "3.5"
2+
3+
services:
4+
postgresql:
5+
image: postgres:12.3
6+
volumes:
7+
- ./config:/docker-entrypoint-initdb.d
8+
environment:
9+
POSTGRES_USER: db_user
10+
POSTGRES_PASSWORD: db_pass
11+
POSTGRES_DB: test_db
12+
POSTGRES_INITDB_ARGS: "--encoding=UTF8"
13+
ports:
14+
- "15432:5432"
15+
16+
backend-development:
17+
image: rust:1.57
18+
environment:
19+
SQL_URL: postgres://db_user:db_pass@postgresql:5432/test_db
20+
RUST_LOG: info
21+
ports:
22+
- "8080:8080"
23+
depends_on:
24+
- postgresql
25+
volumes:
26+
- ./:/app
27+
- cargo-cache:/usr/local/cargo/registry
28+
- target-cache:/app/atcoder-problems-backend/target
29+
working_dir: /app/atcoder-problems-backend
30+
command: /bin/sh -c "while sleep 1000; do :; done"
31+
32+
frontend-development:
33+
image: node:16
34+
ports:
35+
- "3000:3000"
36+
volumes:
37+
- ./:/app
38+
- node_modules:/app/atcoder-problems-frontend/node_modules
39+
working_dir: /app/atcoder-problems-frontend
40+
command: /bin/sh -c "yarn && yarn start"
41+
42+
volumes:
43+
cargo-cache: null
44+
target-cache: null
45+
node_modules: null

0 commit comments

Comments
 (0)