feat: add docker-compose file

This commit is contained in:
alireza
2023-11-09 16:15:12 +03:30
parent 9ce98b6bee
commit 0ca547abe3
+23 -14
View File
@@ -1,32 +1,41 @@
version: "3.9"
services:
app:
image: node:14-alpine
working_dir: /app
command: sh -c "npm i && npm rebuild node-sass && npm run build && npm run start"
volumes:
- .:/app
ports:
- "${PORT}:${PORT}"
depends_on:
- mongo
restart: on-failure
# app:
# image: node:14-alpine
# working_dir: /app
# command: sh -c "npm i && npm rebuild node-sass && npm run build && npm run start"
# volumes:
# - .:/app
# ports:
# - "${PORT}:${PORT}"
# depends_on:
# - mongo
# restart: on-failure
mongo:
image: mongo:4.4.25
networks:
- default
restart: always
expose:
- 27017
ports:
- "27017:27017"
volumes:
- arakrail-data:/etc/mongo
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS}
# MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
# MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS}
MONGO_INITDB_DATABASE: arakrail
# mongo-express:
# image: mongo-express
# networks:
# - default
# restart: always
# expose:
# - 8081
# ports:
# - "8081:8081"
# environment:
@@ -34,7 +43,7 @@ services:
# ME_CONFIG_BASICAUTH_PASSWORD: ${MONGO_PANEL_PASS}
# ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_USER}
# ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_PASS}
# ME_CONFIG_MONGODB_URL: "mongodb://${MONGO_PANEL_USER}:${MONGO_PANEL_PASS}@mongo:27017/"
# ME_CONFIG_MONGODB_URL: "mongodb://${MONGO_USER}:${MONGO_PASS}@mongo:27017/"
# depends_on:
# - mongo