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" version: "3.9"
services: services:
app: # app:
image: node:14-alpine # image: node:14-alpine
working_dir: /app # working_dir: /app
command: sh -c "npm i && npm rebuild node-sass && npm run build && npm run start" # command: sh -c "npm i && npm rebuild node-sass && npm run build && npm run start"
volumes: # volumes:
- .:/app # - .:/app
ports: # ports:
- "${PORT}:${PORT}" # - "${PORT}:${PORT}"
depends_on: # depends_on:
- mongo # - mongo
restart: on-failure # restart: on-failure
mongo: mongo:
image: mongo:4.4.25 image: mongo:4.4.25
networks:
- default
restart: always restart: always
expose:
- 27017
ports: ports:
- "27017:27017" - "27017:27017"
volumes: volumes:
- arakrail-data:/etc/mongo - arakrail-data:/etc/mongo
environment: environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER} # MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS} # MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS}
MONGO_INITDB_DATABASE: arakrail
# mongo-express: # mongo-express:
# image: mongo-express # image: mongo-express
# networks:
# - default
# restart: always # restart: always
# expose:
# - 8081
# ports: # ports:
# - "8081:8081" # - "8081:8081"
# environment: # environment:
@@ -34,7 +43,7 @@ services:
# ME_CONFIG_BASICAUTH_PASSWORD: ${MONGO_PANEL_PASS} # ME_CONFIG_BASICAUTH_PASSWORD: ${MONGO_PANEL_PASS}
# ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_USER} # ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_USER}
# ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_PASS} # 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: # depends_on:
# - mongo # - mongo