jackhammer
jackhammer copied to clipboard
how to give external MYSQL Database details in docker-compose.yml
can any one help me out for giving external MYSQL Database details in docker-compose.yml
in web section, we are configuring docker DB details by default. you can change your DB details here, And you can ignore MySQL DB service configuration,depends_on:
- mysqldb .
can you specify bit elaborated
your docker-compose.yml file should be as follows, Replace DB details with your_db_*
version: '3' volumes: mysql-data: driver: local services: web: build: ./web volumes: - '.:/jackhammer' ports: - "5000:3000" command: bash -c "mkdir -p tmp/pids && RAILS_ENV=production bundle exec rake db:migrate && RAILS_ENV=production bundle exec sidekiq -C config/sidekiq.yml -d && bundle exec puma -e production -b tcp://0.0.0.0:3000" environment: - REDIS_URL=redis://redis:6379 - SECRET_KEY_BASE=454ab84a2554a5e715db90c7560a06d8a20811d614e7313de05495ecdeac9614c4c3d263df1a5892b92d6c32ea06d4defbd2492c598e8295f89b8b316db25842 - RAILS_SERVE_STATIC_FILES=true - RAILS_ENV=production - MYSQL_DB=your_db_name - MYSQL_HOST=your_db_host - MYSQL_USER=your_db_user - MYSQL_PASSWORD=your_db_password links: - redis:redis depends_on: - redis redis: image: redis ports:
- "6379"