Update Dockerfile
Browse files- Dockerfile +4 -3
Dockerfile
CHANGED
|
@@ -43,9 +43,10 @@ RUN wget -t 3 -T 30 -nv -O /opt/src/ikev2.sh https://github.com/hwdsl2/setup-ips
|
|
| 43 |
&& chmod +x /opt/src/ikev2.sh \
|
| 44 |
&& ln -s /opt/src/ikev2.sh /usr/bin
|
| 45 |
|
| 46 |
-
# Set up Python environment and install dependencies
|
| 47 |
COPY requirements.txt /opt/src/
|
| 48 |
-
RUN
|
|
|
|
| 49 |
|
| 50 |
# Copy application files
|
| 51 |
COPY ./run.sh /opt/src/run.sh
|
|
@@ -55,7 +56,7 @@ RUN chmod 755 /opt/src/run.sh
|
|
| 55 |
EXPOSE 500/udp 4500/udp 8000
|
| 56 |
|
| 57 |
# Run both the VPN service and the FastAPI app
|
| 58 |
-
CMD ["/bin/sh", "-c", "uvicorn app:app --host 0.0.0.0 --port 8000"]
|
| 59 |
|
| 60 |
ARG BUILD_DATE
|
| 61 |
ARG VERSION
|
|
|
|
| 43 |
&& chmod +x /opt/src/ikev2.sh \
|
| 44 |
&& ln -s /opt/src/ikev2.sh /usr/bin
|
| 45 |
|
| 46 |
+
# Set up Python virtual environment and install dependencies
|
| 47 |
COPY requirements.txt /opt/src/
|
| 48 |
+
RUN python3 -m venv /opt/venv && \
|
| 49 |
+
/opt/venv/bin/pip install --no-cache-dir -r requirements.txt
|
| 50 |
|
| 51 |
# Copy application files
|
| 52 |
COPY ./run.sh /opt/src/run.sh
|
|
|
|
| 56 |
EXPOSE 500/udp 4500/udp 8000
|
| 57 |
|
| 58 |
# Run both the VPN service and the FastAPI app
|
| 59 |
+
CMD ["/bin/sh", "-c", "/opt/src/run.sh & /opt/venv/bin/uvicorn app:app --host 0.0.0.0 --port 8000"]
|
| 60 |
|
| 61 |
ARG BUILD_DATE
|
| 62 |
ARG VERSION
|