Last active
September 23, 2018 16:27
-
-
Save sevenmaxis/30609fd8a9587027470c7089a46d07d2 to your computer and use it in GitHub Desktop.
environment variables are not applied to container
This file contains 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
version: '3.7' | |
volumes: | |
db_data: | |
services: | |
app: | |
build: | |
context: ../ | |
dockerfile: docker/Dockerfile-app | |
environment: | |
RAILS_ENV: ${DOCKER_RAILS_ENV} | |
MYSQL_ROOT_PASSWORD: ${DOCKER_MYSQL_ROOT_PASSWORD} | |
MY_VAR: 1 | |
depends_on: | |
- db | |
container_name: app | |
env_file: .env | |
db: | |
image: mysql:8.0.12 | |
environment: | |
MYSQL_ROOT_PASSWORD: ${DOCKER_MYSQL_ROOT_PASSWORD} | |
volumes: | |
- db_data:/var/lib/mysql | |
command: mysqld --default-authentication-plugin=mysql_native_password | |
restart: always | |
container_name: db | |
nginx: | |
build: | |
context: ../ | |
dockerfile: docker/Dockerfile-nginx | |
depends_on: | |
- app | |
ports: | |
- ${DOCKER_NGINX_PORT}:80 | |
container_name: nginx |
This file contains 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
ruby@vs03:~/www/docker.com/docker$ d run -it 73798d6f299e bash | |
root@ff13e1deff17:/var/www/citrus# printenv | |
RUBYGEMS_VERSION=2.7.7 | |
BUNDLER_VERSION=1.16.5 | |
HOSTNAME=ff13e1deff17 | |
RUBY_VERSION=2.5.1 | |
GEM_HOME=/usr/local/bundle | |
RAILS_ROOT=/var/www/citrus | |
PWD=/var/www/citrus | |
HOME=/root | |
BUNDLE_PATH=/usr/local/bundle | |
BUNDLE_APP_CONFIG=/usr/local/bundle | |
TERM=xterm | |
BUNDLE_SILENCE_ROOT_WARNING=1 | |
RUBY_MAJOR=2.5 | |
SHLVL=1 | |
RUBY_DOWNLOAD_SHA256=886ac5eed41e3b5fc699be837b0087a6a5a3d10f464087560d2d21b3e71b754d | |
PATH=/usr/local/bundle/bin:/usr/local/bundle/gems/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
_=/usr/bin/printenv |
This file contains 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
Чтобы было понятно как файлы докера лежат | |
ruby@vs03:~/www/docker.com/docker$ tree -a | |
. | |
├── docker-compose.yml | |
├── Dockerfile-app | |
├── Dockerfile-nginx | |
├── .env | |
└── nginx.conf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment