webwebbuild commited on
Commit
34d853a
·
verified ·
1 Parent(s): fdcbc34

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -4
Dockerfile CHANGED
@@ -1,10 +1,11 @@
1
  FROM ghcr.io/mhsanaei/3x-ui:latest
2
 
3
- # Install Nginx to bridge the ports
4
- RUN apt-get update && apt-get install -y nginx
5
 
6
  # Configure Nginx to forward port 7860 traffic to the VPN panel port 2053
7
- RUN echo 'server { \n\
 
8
  listen 7860;\n\
9
  location / { \n\
10
  proxy_pass http://127.0.0.1:2053; \n\
@@ -12,7 +13,7 @@ RUN echo 'server { \n\
12
  proxy_set_header X-Real-IP $remote_addr; \n\
13
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \n\
14
  } \n\
15
- }' > /etc/nginx/sites-available/default
16
 
17
  # Start both the VPN panel and Nginx together
18
  CMD /usr/local/x-ui/x-ui & nginx -g "daemon off;"
 
1
  FROM ghcr.io/mhsanaei/3x-ui:latest
2
 
3
+ # Install Nginx using the Alpine Linux package manager
4
+ RUN apk update && apk add nginx
5
 
6
  # Configure Nginx to forward port 7860 traffic to the VPN panel port 2053
7
+ RUN mkdir -p /run/nginx && \
8
+ echo 'server { \n\
9
  listen 7860;\n\
10
  location / { \n\
11
  proxy_pass http://127.0.0.1:2053; \n\
 
13
  proxy_set_header X-Real-IP $remote_addr; \n\
14
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \n\
15
  } \n\
16
+ }' > /etc/nginx/http.d/default.conf
17
 
18
  # Start both the VPN panel and Nginx together
19
  CMD /usr/local/x-ui/x-ui & nginx -g "daemon off;"