rkihacker commited on
Commit
716af67
·
verified ·
1 Parent(s): 4db6574

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -15
Dockerfile CHANGED
@@ -2,19 +2,21 @@ FROM shadowv2/int-driver:latest
2
 
3
  EXPOSE 8000
4
 
5
- RUN echo '#!/bin/sh\n\
6
- echo "[INFO] Starting container..."\n\
7
- echo "[INFO] Launching shadow background service..."\n\
8
- (\n\
9
- while true; do\n\
10
- echo "[SHADOW] Background task running..."\n\
11
- sleep 10\n\
12
- done\n\
13
- ) &\n\
14
- echo "[INFO] Starting web server on port 8000..."\n\
15
- while true; do\n\
16
- printf "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\nHello! The container is running on port 8000.\n" | nc -l -p 8000 -q 1\n\
17
- done\n\
18
- ' > /server.sh && chmod +x /server.sh
19
 
20
- CMD ["/server.sh"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  EXPOSE 8000
4
 
5
+ # Install Python + venv tools
6
+ RUN apt-get update && apt-get install -y python3 python3-venv python3-pip
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
+ # Create a virtual environment
9
+ RUN python3 -m venv /opt/venv
10
+
11
+ # Activate venv for all future commands
12
+ ENV PATH="/opt/venv/bin:$PATH"
13
+
14
+ # Install FastAPI inside venv
15
+ COPY requirements.txt /requirements.txt
16
+ RUN pip install --no-cache-dir -r /requirements.txt
17
+
18
+ # Copy app
19
+ COPY main.py /main.py
20
+
21
+ # Run FastAPI + shadow driver
22
+ ENTRYPOINT ["python3", "/main.py"]