Skip to content

Commit 04d2ac3

Browse files
committed
feat: working docker compose postgresql db
1 parent fe59bf4 commit 04d2ac3

3 files changed

Lines changed: 19 additions & 18 deletions

File tree

docker-compose.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
version: "3"
21
services:
3-
app:
4-
build: .
5-
command: node build/main.js
6-
environment:
7-
- BOT_TOKEN=${BOT_TOKEN}
2+
postgres:
3+
image: postgres:14.2-alpine
4+
environment:
5+
- POSTGRES_PASSWORD=postgres
6+
- PGDATA=/var/lib/postgresql/data/pgdata
7+
volumes:
8+
- "bots-data:/var/lib/postgresql/data/pgdata"
89

9-
10-
db:
11-
image: postgres:14.5-alpine
12-
restart: always
13-
environment:
14-
- POSTGRES_USER=postgres
15-
- POSTGRES_PASSWORD=postgres
16-
ports:
17-
- '5432:5432'
18-
volumes:
19-
- botsofcode:/var/lib/postgresql/data
10+
botsofcode:
11+
build: .
12+
env_file:
13+
- .env
14+
restart: always
15+
links:
16+
- postgres
2017
volumes:
21-
botsofcode: {}
18+
bots-data: {}

scripts/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npm exec prisma generate
2+
npm run build

scripts/start.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npm exec prisma migrate dev
2+
npm start

0 commit comments

Comments
 (0)