Skip to content

Commit e8bb18e

Browse files
committed
Implement some quality of life updates reg Docker
1 parent 4268e47 commit e8bb18e

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM node:18.18 as node
1+
FROM node:18.18-alpine as node
22

33
WORKDIR /usr/app
44

55
COPY package.json package-lock.json ./
66

77
RUN npm install
8-
COPY . .
8+
COPY . .

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}

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@
3030
"@/guards/*": ["./src/guards/*"],
3131
"@/guards": ["./src/guards"]
3232
}
33+
},
34+
"watchOptions": {
35+
"watchFile": "fixedPollingInterval"
3336
}
3437
}

0 commit comments

Comments
 (0)