Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save oliveira-andre/0bba3e4cff218d5c44a2f6f629522686 to your computer and use it in GitHub Desktop.

Select an option

Save oliveira-andre/0bba3e4cff218d5c44a2f6f629522686 to your computer and use it in GitHub Desktop.
configuration docker-compose rails and mariadb
#set the enviroment variable and create a .env file
cat .env
DATABASE_PASSWORD=$DATABASE_PASSWORD
cat docker-compose.yml
version: "3"
services:
mariadb:
image: mariadb:latest
restart: always
container_name: 'mariadb'
ports:
- 3306:3306
volumes:
- /storage/mariadb:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${DATABASE_PASSWORD}
rails:
build: .
image: oliveiraandre/rails
restart: always
command: rails s -e production
container_name: 'rails'
volumes:
- .:/app
ports:
- 3000:3000
links:
- "mariadb:mariadb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment