-
-
Save Rafat97/bc1d545243ccaffcdbdd50b0865222e6 to your computer and use it in GitHub Desktop.
π³π³ docker-compose & Dockerfile nodeJs mongo π³π³
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
networks: | |
my-network-nodeApp: | |
services: | |
# r_queue: | |
# container_name: rabbitmq | |
# image: rabbitmq:management-alpine | |
# restart: always | |
# ports: | |
# - "15672:15672" | |
# - "5672:5672" | |
# environment: | |
# - RABBITMQ_ERLANG_COOKIE=TESTTESTERTABBITMQ | |
# - RABBITMQ_DEFAULT_USER=rabbitmq | |
# - RABBITMQ_DEFAULT_PASS=rabbitmq | |
# - RABBITMQ_DEFAULT_VHOST=/ | |
# volumes: | |
# - "./docker/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins" | |
# networks: | |
# - my-network-nodeApp | |
db: | |
container_name: mongo | |
image: mongo | |
restart: always | |
ports: | |
- 27017:27017 | |
environment: | |
- MONGO_INITDB_ROOT_USERNAME=root | |
- MONGO_INITDB_ROOT_PASSWORD=example | |
# volumes: | |
# - ./docker/mongodb/data:/data/db | |
networks: | |
- my-network-nodeApp | |
db-mangement: | |
container_name: mongo-express | |
image: mongo-express | |
restart: always | |
depends_on: | |
- db | |
ports: | |
- 8081:8081 | |
environment: | |
ME_CONFIG_MONGODB_ADMINUSERNAME: root | |
ME_CONFIG_MONGODB_ADMINPASSWORD: example | |
ME_CONFIG_MONGODB_SERVER: db | |
networks: | |
- my-network-nodeApp | |
app: | |
build: | |
context: . | |
dockerfile: ./docker/node/Dockerfile.Dev | |
image: "node-app" | |
depends_on: | |
- db | |
container_name: "node-app-setup" | |
restart: always | |
ports: | |
- "8089:8089" | |
volumes: | |
- ./:/usr/src/app | |
- /usr/src/app/node_modules | |
networks: | |
- my-network-nodeApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:lts-alpine | |
WORKDIR /usr/src/app | |
COPY ./package.json /usr/src/app | |
# VOLUME [ "./" , '/usr/src/app' ] | |
RUN npm install | |
CMD npm start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment