be based on docker Of nginx, Sometimes we hope nginx Configuration file for (conf) Read environment variables directly , This can be done in the docker outside , Through environment variables , Control runs in docker In the middle nginx service .

e.g.
default.conf.template Is with environment variables nginx configuration file , hope docker After operation , It can run according to the value of environment variable .
# docker-compose.yml version: "2.3" services: test-server: container_name: test
-server image: test-server:latest ports: - "443:443" # environment variable , Save in .env In the file env_file
: - ./.env # NGINX_ENVSUBST_TEMPLATE_SUFFIX, It has to be , #
hold /opt/test-server/etc All extensions are .template File for , Replace by environment variable # Save as .template File with extension .
(default.conf.template => default.conf) # Save as , Save in the same directory environment:
NGINX_ENVSUBST_TEMPLATE_SUFFIX: ".template" volumes: - /opt/test-server/etc:
/etc/nginx/templates/- /opt/test-server/etc:/etc/nginx/conf.d - /opt/test-
server/logs:/var/log/nginx
such , Every start (docker-compose up -d), Will be based on default.conf.template,
After replacing environment variables , generate default.conf, Then start it again docker.

Technology
©2019-2020 Toolsou All rights reserved,
Huawei 2021 session Hardware Engineer Logical post (FPGA) Super detailed surface !!!Vue-element-admin upgrade ui edition virtual machine VMware Download and install the most detailed tutorial !C++ Move constructor and copy constructor sound of dripping water java Backstage interview pygame Realize full screen mode and adjustable window size mysql Database setting character set configuration modification my.ini file (windows)30 What's the experience of being a junior programmer at the age of 20 C++ Multithreading programming ( Summary of common functions and parameters )python_ cherry tree