BinaryONe commited on
Commit
8e35bdc
·
1 Parent(s): 9576da4

Nginx Changes-Over Alpine

Browse files
Files changed (2) hide show
  1. Dockerfile +11 -2
  2. www.privateone-teleapi.hf.space.conf +18 -0
Dockerfile CHANGED
@@ -2,13 +2,17 @@ FROM alpine:latest
2
 
3
  # Install system dependencies
4
  RUN apk update && apk upgrade && \
5
- apk add --no-cache nginx python3 python3-dev py3-pip build-base libffi-dev openssl-dev shadow gcc musl-dev ca-certificates sudo
6
 
7
  # Create a group and user
8
  RUN addgroup -S appgroup && adduser -S appuser -G appgroup
9
 
10
  # Add appuser to the sudoers file (allowing all commands without password)
11
  RUN echo "appuser ALL=(ALL:ALL) ALL" >> /etc/sudoers
 
 
 
 
12
  # Set working directory
13
  WORKDIR /app
14
 
@@ -23,9 +27,11 @@ RUN python3 -m venv /app/venv && \
23
  COPY . /app
24
 
25
  # Copy Nginx config
26
- COPY default_conf.conf /etc/nginx/conf.d/default.conf
27
  #COPY nginx.conf /etc/nginx/nginx.conf
28
 
 
 
29
  #RUN touch /var/lib/nginx/logs/error.log && \
30
  # chmod 777 /var/lib/nginx/logs/error.log
31
 
@@ -45,6 +51,9 @@ RUN cat /etc/nginx/nginx.conf && echo "--------------------" && cat /etc/nginx/c
45
  # Switch to non-root user
46
  USER appuser
47
 
 
 
 
48
  EXPOSE 7860
49
 
50
  # Start Nginx and your application (using exec and the correct Python path)
 
2
 
3
  # Install system dependencies
4
  RUN apk update && apk upgrade && \
5
+ apk add --no-cache nginx python3 python3-dev py3-pip build-base libffi-dev openssl-dev shadow gcc musl-dev ca-certificates sudo openrc
6
 
7
  # Create a group and user
8
  RUN addgroup -S appgroup && adduser -S appuser -G appgroup
9
 
10
  # Add appuser to the sudoers file (allowing all commands without password)
11
  RUN echo "appuser ALL=(ALL:ALL) ALL" >> /etc/sudoers
12
+
13
+ # Add appuser to the sudoers file (allowing all commands without password)
14
+ RUN echo "nginx ALL=(ALL:ALL) ALL" >> /etc/sudoers
15
+
16
  # Set working directory
17
  WORKDIR /app
18
 
 
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
  #COPY nginx.conf /etc/nginx/nginx.conf
32
 
33
+
34
+ RUN service nginx start
35
  #RUN touch /var/lib/nginx/logs/error.log && \
36
  # chmod 777 /var/lib/nginx/logs/error.log
37
 
 
51
  # Switch to non-root user
52
  USER appuser
53
 
54
+ RUN /etc/init.d/nginx status
55
+
56
+
57
  EXPOSE 7860
58
 
59
  # Start Nginx and your application (using exec and the correct Python path)
www.privateone-teleapi.hf.space.conf ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 7860;
3
+ proxy_buffering off;
4
+ proxy_cache off;
5
+ sendfile on;
6
+ tcp_nopush on;
7
+ tcp_nodelay on;
8
+
9
+ location / {
10
+ proxy_pass http://127.0.0.1:8080;
11
+ proxy_set_header Host $host;
12
+ proxy_set_header X-Real-IP $remote_addr;
13
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
14
+ proxy_set_header Range $http_range;
15
+ proxy_set_header If-Range $http_if_range;
16
+ add_header Accept-Ranges bytes;
17
+ }
18
+ }