Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adicionando o docker-compose #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TAG=latest
35 changes: 35 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3.8'

volumes:
mongo_vol:

networks:
produto_net:
driver: bridge

services:
api:
env_file: .env
image: rafaelroxen/api-produto:${TAG}
ports:
- 8080:8080
networks:
- produto_net
environment:
MONGODB_URI: mongodb://mongouser:mongopwd@mongodb:27017/admin
depends_on:
- mongodb


mongodb:
image: mongo:4.4.3
ports:
- 27017:27017
networks:
- produto_net
volumes:
- mongo_vol:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: mongouser
MONGO_INITDB_ROOT_PASSWORD: mongopwd

1 change: 1 addition & 0 deletions src/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
11 changes: 11 additions & 0 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:14.15.4

WORKDIR /app

COPY package*.json ./
RUN npm install
COPY . .

EXPOSE 8080

CMD ["node", "app.js"]