Skip to content

Commit 7640e31

Browse files
coelhotatianefilipepacheco
authored andcommitted
Implement some quality of life updates reg Docker
1 parent a6469b6 commit 7640e31

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

docker-compose.dev.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,34 @@ version: '3.8'
33
services:
44
api:
55
container_name: sos-rs-api
6-
image: node:18.18
6+
image: node:18.18-alpine
77
restart: always
88
tty: true
99
depends_on:
1010
- db
1111
ports:
12-
- '4000:4000'
12+
- "${PORT}:${PORT}"
1313
volumes:
1414
- .:/usr/app
1515
- /usr/app/node_modules
1616
working_dir: '/usr/app'
1717
environment:
18-
- DB_HOST=sos-rs-db
19-
- DB_PORT=5432
20-
- DB_DATABASE_NAME=sos_rs
21-
- DB_USER=root
22-
- DB_PASSWORD=root
18+
- DB_HOST=${DB_HOST}
19+
- DB_PORT=${DB_PORT}
20+
- DB_DATABASE_NAME=${DB_DATABASE_NAME}
21+
- DB_USER=${DB_USER}
22+
- DB_PASSWORD=${DB_PASSWORD}
23+
- PORT=${PORT}
2324
command: >
2425
sh -c "npm install &&
2526
npx prisma generate &&
2627
npx prisma migrate dev &&
27-
npm run start:dev"
28+
npm run start:dev -- --preserveWatchOutput"
2829
db:
2930
container_name: sos-rs-db
3031
image: postgres
32+
ports:
33+
- "${DB_PORT}:${DB_PORT}"
3134
environment:
32-
- POSTGRES_PASSWORD=root
33-
- POSTGRES_USER=root
35+
- POSTGRES_PASSWORD=${DB_PASSWORD}
36+
- POSTGRES_USER=${DB_USER}

0 commit comments

Comments
 (0)