Skip to content

Commit

Permalink
Merge pull request #98 from marcelobalexandre/dockerize
Browse files Browse the repository at this point in the history
Dockerize the API app
  • Loading branch information
brunohcastro committed Dec 8, 2021
2 parents 3c42f5b + 886158f commit 333e25a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
29 changes: 27 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
version: "3.5"
version: "3.9"

services:
api:
image: node:16.13
container_name: node-api-boilerplate
depends_on:
- mongodb
command: bash -c "yarn install && yarn dev"
working_dir: /api
volumes:
- .:/api
ports:
- 3000:3000
environment:
HOST: 0.0.0.0
DB_HOST: mongodb://node-api-boilerplate-mongodb:27017

mongodb:
container_name: blog-mongodb
container_name: node-api-boilerplate-mongodb
image: mongo:4.2
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: blog
MONGO_INITDB_ROOT_PASSWORD: blog

mongo-express:
container_name: node-api-boilerplate-mongo-express
image: mongo-express
depends_on:
- mongodb
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_URL: mongodb://blog:blog@node-api-boilerplate-mongodb:27017
1 change: 0 additions & 1 deletion src/_boot/swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const swagger = makeModule('swagger', async ({ container: { build }, config: { h
title: swagger.title,
version: swagger.version,
},
host: `${http.host}:${http.port}`,
basePath: swagger.basePath,
},
apis: [resolve(__dirname, '../**/interface/http/**/*.yaml'), resolve(__dirname, '../**/interface/http/**/*.ts')],
Expand Down

0 comments on commit 333e25a

Please sign in to comment.