Created
June 3, 2018 18:43
-
-
Save oliveira-andre/0bba3e4cff218d5c44a2f6f629522686 to your computer and use it in GitHub Desktop.
configuration docker-compose rails and mariadb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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