kuyesu22 commited on
Commit
915c0a3
·
verified ·
1 Parent(s): b4a8f60

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Create a non-root user
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
+ # Set the working directory
9
+ WORKDIR /app
10
+
11
+ # Install Python dependencies
12
+ COPY --chown=user ./requirements.txt requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ # Expose port for Hugging Face
16
+ EXPOSE 7860
17
+
18
+ # Install IPython kernel for the current user
19
+ RUN python3 -m ipykernel install --user
20
+
21
+ # Set CMD to run the kernel gateway on port 7860
22
+ CMD ["jupyter", "kernelgateway", "--ip=0.0.0.0", "--port=7860", "--KernelGatewayApp.allow_origin='*'", "--JupyterWebsocketPersonality.list_kernels=True"]