Skip to content

Commit 457deb3

Browse files
committed
added and user variable in snippets #32
1 parent 8f7f54b commit 457deb3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

Dockerfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
FROM openresty/openresty:alpine-fat
22

33
# allowed domains should be lua match pattern
4-
ENV DIFFIE_HELLMAN='' ALLOWED_DOMAINS='.*' AUTO_SSL_VERSION='0.13.1' FORCE_HTTPS='true' SITES='' LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory'
4+
ENV DIFFIE_HELLMAN='' \
5+
ALLOWED_DOMAINS='.*' \
6+
AUTO_SSL_VERSION='0.13.1' \
7+
FORCE_HTTPS='true' \
8+
SITES='' \
9+
LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory' \
10+
RESOLVER_ADDRESS='8.8.8.8'
511

612
# Here we install open resty and generate dhparam.pem file.
713
# You can specify DIFFIE_HELLMAN=true to force regeneration of that file on first run

entrypoint.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ if [ "$FORCE_HTTPS" == "true" ]; then
5858
fi
5959

6060

61-
# let's substitute $ALLOWED_DOMAINS and $LETSENCRYPT_URL into OpenResty configuration
62-
envsubst '$ALLOWED_DOMAINS,$LETSENCRYPT_URL' \
61+
# let's substitute $ALLOWED_DOMAINS, $LETSENCRYPT_URL and $RESOLVER_ADDRESS into OpenResty configuration
62+
envsubst '$ALLOWED_DOMAINS,$LETSENCRYPT_URL,$RESOLVER_ADDRESS' \
6363
< ${RESTY_CONF_DIR}/resty-http.conf \
6464
> ${RESTY_CONF_DIR}/resty-http.conf.copy \
6565
&& mv ${RESTY_CONF_DIR}/resty-http.conf.copy ${RESTY_CONF_DIR}/resty-http.conf

snippets/resty-http.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ lua_shared_dict auto_ssl_settings 64k;
1414
# default DNS servers, which can be found in /etc/resolv.conf. If your network
1515
# is not IPv6 compatible, you may wish to disable IPv6 results by using the
1616
# "ipv6=off" flag (like "resolver 8.8.8.8 ipv6=off").
17-
resolver 8.8.8.8;
17+
resolver $RESOLVER_ADDRESS;
1818

1919
# Initial setup tasks.
2020
init_by_lua_block {

0 commit comments

Comments
 (0)