File size: 730 Bytes
0635d06
 
 
 
 
 
 
 
 
 
a11a772
4c5bb2a
cc78539
 
 
 
 
 
0635d06
 
 
 
 
 
 
 
 
cc78539
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Use a lightweight Python base image
FROM python:3.11-slim

# Set the working directory
WORKDIR /app

# Install the pvpn library
RUN pip install pvpn


RUN chmod -R 777 /app

RUN useradd -m -u 1000 user
USER user



COPY --chown=user . /app
# Expose the standard IKEv2 ports (UDP 500 and 4500)
# Note: The 'pvpn' server runs as root inside the container to bind to these ports,
# but the container is run by a non-root user on the host.
EXPOSE 500/udp
EXPOSE 4500/udp

# Command to run the server script
# We use 'python3' instead of 'sudo python3' because the container runs as root by default,
# which is necessary to bind to the privileged ports 500 and 4500.

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]