Skip to content

Commit 44e2616

Browse files
committed
chore: update setup docker
1 parent ab93d58 commit 44e2616

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
build
3+
.vscode
4+
node_modules

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ FROM node:14-alpine
22

33
WORKDIR /usr/app
44

5-
COPY package*.json ./
5+
COPY package*.json yarn.lock ./
66

77
RUN yarn
88

99
COPY . .
1010

11-
EXPOSE 3333
11+
# RUN yarn build
1212

13+
# RUN rm -rf ./src ./.github ./.husky
14+
15+
EXPOSE 3335
16+
17+
# CMD ["yarn", "start"]
1318
CMD ["yarn", "dev"]

docker-compose.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
version: '3.7'
22

33
services:
4-
api:
4+
database:
5+
image: postgres
6+
container_name: compasso_db
7+
restart: always
8+
ports:
9+
- '${POSTGRES_PORT}:${POSTGRES_PORT}'
10+
environment:
11+
- POSTGRES_USER=${POSTGRES_USER}
12+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
13+
- POSTGRES_DB=${POSTGRES_DB}
14+
15+
app:
516
build: .
6-
container_name: api
17+
container_name: compasso_api
718
restart: always
819
ports:
920
- '${API_PORT}:${API_PORT}'
1021
volumes:
11-
- .:/usr/api
22+
- .:/usr/app
23+
links:
24+
- database
25+
depends_on:
26+
- database
27+
28+
volumes:
29+
pgdata:
30+
driver: local

0 commit comments

Comments
 (0)