york commited on
Commit
a2da38d
·
verified ·
1 Parent(s): 6a5b8d8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -35
Dockerfile CHANGED
@@ -1,35 +1,35 @@
1
- # VPN Server with FastAPI
2
- FROM python:3.11-slim
3
-
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Install system dependencies
8
- RUN apt-get update && apt-get install -y \
9
- build-essential \
10
- python3-dev \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- # Copy requirements and install Python dependencies
14
- COPY requirements.txt .
15
- RUN pip install --no-cache-dir -r requirements.txt
16
-
17
- # Create non-root user
18
- RUN useradd -m -u 1000 vpnuser && \
19
- chown -R vpnuser:vpnuser /app
20
-
21
- # Copy application files
22
- COPY --chown=vpnuser:vpnuser . .
23
-
24
- # Set environment variables
25
- ENV PYTHONPATH=/app
26
- ENV PYTHONUNBUFFERED=1
27
-
28
- # Switch to non-root user
29
- USER vpnuser
30
-
31
- # Expose port
32
- EXPOSE 7860
33
-
34
- # Run the application with uvicorn
35
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]
 
1
+ # VPN Server with FastAPI
2
+ FROM python:3.11-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
+ python3-dev \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Copy requirements and install Python dependencies
14
+ COPY requirements.txt .
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # Create non-root user
18
+ RUN useradd -m -u 1000 vpnuser && \
19
+ chown -R vpnuser:vpnuser /app
20
+
21
+ # Copy application files
22
+ COPY --chown=vpnuser:vpnuser . .
23
+
24
+ # Set environment variables
25
+ ENV PYTHONPATH=/app:./
26
+ ENV PYTHONUNBUFFERED=1
27
+
28
+ # Switch to non-root user
29
+ USER vpnuser
30
+
31
+ # Expose port
32
+ EXPOSE 7860
33
+
34
+ # Run the application with uvicorn
35
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]