Skip to content

Commit 333e25a

Browse files
authored
Merge pull request #98 from marcelobalexandre/dockerize
Dockerize the API app
2 parents 3c42f5b + 886158f commit 333e25a

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

docker-compose.yaml

+27-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1-
version: "3.5"
1+
version: "3.9"
22

33
services:
4+
api:
5+
image: node:16.13
6+
container_name: node-api-boilerplate
7+
depends_on:
8+
- mongodb
9+
command: bash -c "yarn install && yarn dev"
10+
working_dir: /api
11+
volumes:
12+
- .:/api
13+
ports:
14+
- 3000:3000
15+
environment:
16+
HOST: 0.0.0.0
17+
DB_HOST: mongodb://node-api-boilerplate-mongodb:27017
18+
419
mongodb:
5-
container_name: blog-mongodb
20+
container_name: node-api-boilerplate-mongodb
621
image: mongo:4.2
722
ports:
823
- 27017:27017
924
environment:
1025
MONGO_INITDB_ROOT_USERNAME: blog
1126
MONGO_INITDB_ROOT_PASSWORD: blog
27+
28+
mongo-express:
29+
container_name: node-api-boilerplate-mongo-express
30+
image: mongo-express
31+
depends_on:
32+
- mongodb
33+
ports:
34+
- 8081:8081
35+
environment:
36+
ME_CONFIG_MONGODB_URL: mongodb://blog:blog@node-api-boilerplate-mongodb:27017

src/_boot/swagger.ts

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const swagger = makeModule('swagger', async ({ container: { build }, config: { h
1919
title: swagger.title,
2020
version: swagger.version,
2121
},
22-
host: `${http.host}:${http.port}`,
2322
basePath: swagger.basePath,
2423
},
2524
apis: [resolve(__dirname, '../**/interface/http/**/*.yaml'), resolve(__dirname, '../**/interface/http/**/*.ts')],

0 commit comments

Comments
 (0)