Skip to content

Commit c017830

Browse files
klpxthekiba
authored andcommitted
Fix DNS resolver
1 parent 0866415 commit c017830

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ FROM nginx:alpine
3434

3535
ARG ASSETS_PREFIX=assets
3636

37-
COPY --from=builder /build/nginx.conf /etc/nginx/nginx.conf
37+
ENV NGINX_RESOLVER=8.8.8.8
38+
39+
COPY --from=builder /build/nginx.conf /etc/nginx/nginx.conf.template
3840
COPY --from=builder /build/wallets-v2.proxy.json /usr/share/nginx/html/wallets-v2.json
3941
COPY --from=builder /build/wallets.json /usr/share/nginx/html/wallets.json
4042
COPY assets/ /var/www/predownloaded_images/${ASSETS_PREFIX}/
@@ -45,4 +47,5 @@ RUN mkdir -p /var/cache/nginx/image_cache && \
4547

4648
EXPOSE 80
4749

48-
CMD ["nginx", "-g", "daemon off;"]
50+
CMD envsubst '${NGINX_RESOLVER}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && \
51+
nginx -g "daemon off;"

docker-compose.test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ version: '3.8'
33
services:
44
ton-wallets:
55
image: ${IMAGE:-ton-wallets-local}
6+
environment:
7+
NGINX_RESOLVER: 1.1.1.1
68
ports:
79
- "${TEST_PORT:-8088}:80"
810
healthcheck:

server/nginx.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ http {
2121
# Send access logs to stdout
2222
access_log /dev/stdout main_with_cache;
2323

24-
resolver 192.168.65.7 valid=3s;
25-
resolver_timeout 1s;
24+
resolver ${NGINX_RESOLVER} valid=5m;
25+
resolver_timeout 3s;
2626

2727
proxy_cache_path /var/cache/nginx/image_cache
2828
levels=1:2

0 commit comments

Comments
 (0)