Last active
March 5, 2023 00:19
-
-
Save aluissp/f32dc0155bedd20dc50d66762e82de15 to your computer and use it in GitHub Desktop.
Simple config to Dockerfile and docker-compose.yml
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.9" | |
services: | |
animals-app: | |
build: | |
context: . | |
dockerfile: Dockerfile.dev | |
ports: | |
- "3000:3000" | |
links: | |
- animals-db | |
volumes: | |
- .:/home/app | |
animals-db: | |
image: mongo | |
ports: | |
- "3005:27017" | |
environment: | |
- MONGO_INITDB_ROOT_USERNAME=luis | |
- MONGO_INITDB_ROOT_PASSWORD=2002 | |
volumes: | |
- mongo-data:/data/db | |
# mysql => /var/lib/mysql | |
# postgres => /var/lib/postgresql/data | |
volumes: | |
mongo-data: |
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.9" | |
services: | |
animals-app: | |
build: . | |
ports: | |
- "3000:3000" | |
links: | |
- animals-db | |
animals-db: | |
image: mongo | |
ports: | |
- "3005:27017" | |
environment: | |
- MONGO_INITDB_ROOT_USERNAME=luis | |
- MONGO_INITDB_ROOT_PASSWORD=2002 | |
volumes: | |
- mongo-data:/data/db | |
# mysql => /var/lib/mysql | |
# postgres => /var/lib/postgresql/data | |
volumes: | |
mongo-data: | |
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:18 | |
RUN mkdir -p /home/app | |
COPY . /home/app | |
EXPOSE 3000 | |
CMD ["node", "/home/app/index.js" ] |
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:18 | |
RUN npm i -g nodemon | |
RUN mkdir -p /home/app | |
WORKDIR /home/app | |
EXPOSE 3000 | |
CMD ["nodemon", "index.js" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment