BinaryONe commited on
Commit
1b09b20
·
1 Parent(s): 7601e69

Nginx Changes

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -3
Dockerfile CHANGED
@@ -27,16 +27,20 @@ RUN python3 -m venv /app/venv && \
27
  COPY . /app
28
 
29
  # Copy Nginx config
30
- COPY www.privateone-teleapi.hf.space.conf /etc/nginx/conf.d/www.privateone-teleapi.hf.space.conf
 
31
 
32
  # Create necessary directories and set correct permissions (fix ownership)
33
  RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
34
  chown -R nginx:nginx /var/lib/nginx /var/log/nginx /run/nginx && \
35
- chown -R user:user /app /var/www/html /var/lib/nginx && chmod -R 777 /app
36
 
37
  # Remove the user directive from the main nginx.conf (not needed)
38
  #RUN sed -i '/^user /d' /etc/nginx/nginx.conf
39
 
 
 
 
40
  # Print the configuration files to the console (good addition)
41
  RUN cat /etc/nginx/nginx.conf && echo "--------------------"
42
  # && cat /etc/nginx/conf.d/default.conf
@@ -45,4 +49,4 @@ RUN cat /etc/nginx/nginx.conf && echo "--------------------"
45
  USER appuser
46
 
47
  # Start Nginx and your application (using exec and the correct Python path)
48
- CMD ["sh", "-c", "rc-service nginx -s reload && exec /app/venv/bin/python -u -m FileStream"]
 
27
  COPY . /app
28
 
29
  # Copy Nginx config
30
+ #COPY www.privateone-teleapi.hf.space.conf /etc/nginx/conf.d/www.privateone-teleapi.hf.space.conf
31
+ RUN mv nginx-new.conf /etc/nginx/nginx.conf
32
 
33
  # Create necessary directories and set correct permissions (fix ownership)
34
  RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
35
  chown -R nginx:nginx /var/lib/nginx /var/log/nginx /run/nginx && \
36
+ chown -R user:user /app /var/www/html /var/lib/nginx && chmod -R 777 /app
37
 
38
  # Remove the user directive from the main nginx.conf (not needed)
39
  #RUN sed -i '/^user /d' /etc/nginx/nginx.conf
40
 
41
+ #You may want to make backup of original nginx.conf file before writting your own
42
+ RUN mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig
43
+
44
  # Print the configuration files to the console (good addition)
45
  RUN cat /etc/nginx/nginx.conf && echo "--------------------"
46
  # && cat /etc/nginx/conf.d/default.conf
 
49
  USER appuser
50
 
51
  # Start Nginx and your application (using exec and the correct Python path)
52
+ CMD ["sh", "-c", "rc-service nginx reload && exec /app/venv/bin/python -u -m FileStream"]