skip to Main Content

docker-compose – how to pass env variable from .env to Dockerfile? – Nginx

I have a docker-compose that looks like this, in part: nginx: container_name: ${NGINX_CONTAINER_NAME} ports: - ${NGINX_HTTP_PORT1}:${NGINX_HTTP_PORT2} - ${NGINX_HTTPS_PORT1}:${NGINX_HTTPS_PORT2} build: dockerfile: Dockerfile args: - NGINX_VERSION=${NGINX_VERSION} volumes: - ${NGINX_CONF_DIR:-./nginx}:/etc/nginx/conf.d - ${NGINX_LOG_DIR:-./logs/nginx}:/var/log/nginx - ${WORDPRESS_DATA_DIR:-./wordpress}:/var/www/html depends_on: - wordpress restart: always As you can see,…

VIEW QUESTION
Back To Top
Search