Skip to content

Commit

Permalink
add docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Feb 28, 2024
1 parent f5f6639 commit 15565d5
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 43 deletions.
11 changes: 5 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
logs
*.log
coverage
lib
.idea
.github/
coverage/
dist/
node_modules/
.env
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM node:18-alpine AS base

WORKDIR /project
COPY . .
RUN npm ci
Expand Down
60 changes: 40 additions & 20 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
version: "3.9"

services:
app:
build:
context: .
target: dev
dockerfile: Dockerfile
environment:
- NODE_ENV=test
- PORT=3000
- DB_HOST=mongo
- DB_PORT=27017
- DB_USER=root
- DB_PASSWORD=pass
- DB_NAME=RnDAO
- DISCORD_CLIENT_ID=1
- DISCORD_CLIENT_SECRET=1
- SENTRY_DSN=1
- SENTRY_ENV=test
- DISCORD_BOT_TOKEN=1
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=
- RABBIT_HOST=localhost
- RABBIT_PORT=5672
- RABBIT_USER=root
- RABBIT_PASSWORD=pass
- LOG_LEVEL=info
- PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040
volumes:
- ./coverage:/project/coverage
depends_on:
mongo:
condition: service_healthy
mongo:
image: "mongo:6.0.8"
ports:
- 27017:27017
image: "mongo:5.0.10"
environment:
- MONGO_INITDB_DATABASE=RnDAO
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=pass
rabbitmq:
image: "rabbitmq:3-management-alpine"
ports:
- 5672:5672
- 15672:15672
environment:
- RABBITMQ_DEFAULT_USER=root
- RABBITMQ_DEFAULT_PASS=pass
neo4j:
image: "neo4j:5.9.0"
ports:
- 7687:7687
- 7474:7474
environment:
- NEO4J_AUTH=neo4j/password
- NEO4J_PLUGINS=["apoc", "graph-data-science"]
- NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.*
healthcheck:
test: echo 'db.stats().ok' | mongosh localhost:27017/test --quiet
interval: 60s
timeout: 10s
retries: 2
start_period: 40s
38 changes: 21 additions & 17 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ services:
target: test
dockerfile: Dockerfile
environment:
- NODE_ENV=test
- PORT=3000
- DB_HOST=mongo
- DB_PORT=27017
- DB_USER=root
- DB_PASSWORD=pass
- DB_NAME=RnDAO-test
- DB_NAME=Core
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=
- RABBIT_HOST=rabbitmq
- RABBIT_PORT=5672
- RABBIT_USER=root
Expand All @@ -25,22 +27,26 @@ services:
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=password
- NEO4J_DB=neo4j
- SENTRY_DSN=https://b9a3cf6fc9b849b6a9fdbd19dbb3a0eb@o4505110094282752.ingest.sentry.io/4505110103130112
- SENTRY_ENV=test
- DISCORD_TRY_NOW_CALLBACK_URI=http://localhost:3000/api/v1/auth/try-now/callback
- DISCORD_LOGIN_CALLBACK_URI=http://localhost:3000/api/v1/auth/login/callback
- DISCORD_CONNECT_GUILD_CALLBACK_URI=http://localhost:3000/api/v1/guilds/connect/callback
- DISCROD_CLIENT_ID=1062450481529638963
- DISCORD_CLIENT_SECRET=hTgn0dndAJz6oYhpxNGp3hc-ekxXp3Nj
- DISCORD_BOT_TOKEN=MTA2MjQ1MDQ4MTUyOTYzODk2Mw.GHhWYD.J4DhMWLAPy1lRV7YAB03YbVtjY6DFYk0UoipD8
- JWT_SECRET=0%55e*enasdfm@@u7v9+amg-ju_d_ladsfasdf6(v*88h4$#h&o-i7a4%tv*hx
- SENTRY_DSN=empty
- SENTRY_ENV=empty
- DISCORD_AUTHORIZE_CALLBACK_URI=empty
- DISCORD_CONNECT_CALLBACK_URI=empty
- DISCORD_REQUEST_ACCESS_CALLBACK_URI=empty
- TWITTER_CONNECT_CALLBACK_URI=empty
- TWITTER_CLIENT_ID=empty
- TWITTER_CLIENT_SECRET=empty
- DISCROD_CLIENT_ID=empty
- DISCORD_CLIENT_SECRET=empty
- DISCORD_BOT_TOKEN=empty
- JWT_SECRET=0%55e*enmvbfm@@u7v9+amg-ju_d_safeasdf6(v*88h4$#h&o-i7ste#tv*hx
- JWT_ACCESS_EXPIRATION_MINUTES=30
- JWT_REFRESH_EXPIRATION_DAYS=30
- JWT_DISCORD_REFRESH_EXPIRATION_DAY=30
- FRONTEND_URL=https://localhost:3000/login
- NOTION_API_KEY=secret_INw8tqjWs80yXTOndXrpfp44HxLAvpMzGNkQ2XxkvqM
- NOTION_DATABASE_ID=948a3d77051f4f9b848319819d776709
- BRIDGE_API_KEY=fa718429-8ac1-49a3-8715-7786cf9c09be
- FRONTEND_URL=empty
- NOTION_API_KEY=empty
- NOTION_DATABASE_ID=empty
- LOG_LEVEL=trace
- SESSION_SECRET=0%532345*edm@@u7v9+att-sdfed_l6(v*88h4$#h&o-i7awer3tv*yy

volumes:
- ./coverage:/project/coverage
Expand Down Expand Up @@ -68,6 +74,7 @@ services:
mongo:
image: "mongo:6.0.8"
environment:
- MONGO_INITDB_DATABASE=Core
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=pass
healthcheck:
Expand Down Expand Up @@ -106,6 +113,3 @@ services:
networks:
- api_application_network

networks:
api_application_network:
driver: bridge

0 comments on commit 15565d5

Please sign in to comment.