Fred808 commited on
Commit
fe26e2a
·
verified ·
1 Parent(s): 38420d7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -4
Dockerfile CHANGED
@@ -44,19 +44,21 @@ RUN wget -t 3 -T 30 -nv -O /opt/src/ikev2.sh https://github.com/hwdsl2/setup-ips
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
53
- COPY ./app.py /opt/src/
54
  RUN chmod 755 /opt/src/run.sh
55
 
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
 
44
  && ln -s /opt/src/ikev2.sh /usr/bin
45
 
46
  # Set up Python virtual environment and install dependencies
47
+ # Assuming a requirements.txt exists or we install necessary packages directly
48
+ # Since requirements.txt was not provided, I will assume fastapi and uvicorn are needed.
49
  COPY requirements.txt /opt/src/
50
  RUN python3 -m venv /opt/venv && \
51
+ /opt/venv/bin/pip install --no-cache-dir -r /opt/src/requirements.txt
52
 
53
  # Copy application files
54
  COPY ./run.sh /opt/src/run.sh
55
+ COPY /home/ubuntu/app.py /opt/src/app.py
56
  RUN chmod 755 /opt/src/run.sh
57
 
58
  EXPOSE 500/udp 4500/udp 8000
59
 
60
+ # Run app.py, which in turn runs run.sh
61
+ CMD ["/opt/venv/bin/python3", "/opt/src/app.py"]
62
 
63
  ARG BUILD_DATE
64
  ARG VERSION