Skip to content

Instantly share code, notes, and snippets.

@gagansh7171
Created August 23, 2020 18:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save gagansh7171/868eac6c55aa531f337ee5a6abeb13c9 to your computer and use it in GitHub Desktop.
Docker Compose File
version: "3.2"
services:
redis:
restart: always
image: redis:5
ports:
- "6379:6379"
networks:
- db-net
db:
restart: always
image: mariadb:5.5
environment:
- MYSQL_HOST=localhost
- MYSQL_PORT=3306
- MYSQL_ROOT_HOST=%
- MYSQL_DATABASE=bug
- MYSQL_USER=<<username>>
- MYSQL_PASSWORD=<<password>>
- MYSQL_ROOT_PASSWORD=<<rootpassword>>
ports:
- "3302:3306"
networks:
- db-net
project:
restart: always
container_name: code
command : bash -c "python check_db.py --service-name db --ip db --port 3306 &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
env_file:
- ./project/settings.ini
build:
context: ./project/
dockerfile: Dockerfile
ports:
- "8000:8000"
depends_on:
- db
- redis
networks:
- db-net
frontend:
restart: always
command : npm start
container_name: front
build:
context: ./frontend/
dockerfile: Dockerfile
ports:
- "3000:3000"
stdin_open: true
depends_on:
- project
networks:
- db-net
networks:
db-net:
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment