Ramses II commited on
Commit
7182945
1 Parent(s): f1bd50d

first deploy

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -10
Dockerfile CHANGED
@@ -8,20 +8,30 @@ COPY requirements.txt .
8
 
9
  COPY public /app/public
10
 
11
- # Switch to root user to install system packages
12
  USER root
13
 
14
  # Install the dependencies
15
  RUN apt-get update && apt-get install -y wget nginx && pip install -r requirements.txt
16
 
 
 
 
 
 
 
 
 
17
  # Switch back to the original user
18
- USER ${NB_UID}
 
19
 
20
- # Copy the JupyterLab configuration file
21
- COPY jupyter_config.py /etc/jupyterlab/jupyter_config.py
 
22
 
23
- # Copy the Nginx configuration file
24
- COPY nginx.conf /etc/nginx/nginx.conf
25
 
26
  # Expose the port 8888 for JupyterLab
27
  EXPOSE 8888
@@ -34,9 +44,5 @@ ENV JUPYTERLAB_PORT=8888
34
  ENV JUPYTERLAB_TOKEN=your_secret_token
35
  ENV NGINX_PORT=7860
36
 
37
- # Copy the entrypoint script
38
- COPY entrypoint.sh /app/entrypoint.sh
39
- RUN chmod +x /app/entrypoint.sh
40
-
41
  # Run the entrypoint script when the container starts
42
  ENTRYPOINT ["/app/entrypoint.sh"]
 
8
 
9
  COPY public /app/public
10
 
11
+ # Switch to root user to install system packages and set permissions
12
  USER root
13
 
14
  # Install the dependencies
15
  RUN apt-get update && apt-get install -y wget nginx && pip install -r requirements.txt
16
 
17
+ # Copy the configuration files and entrypoint script
18
+ COPY jupyter_config.py /etc/jupyter/jupyter_config.py
19
+ COPY nginx.conf /etc/nginx/nginx.conf
20
+ COPY entrypoint.sh /app/entrypoint.sh
21
+
22
+ # Set the entrypoint script as executable
23
+ RUN chmod +x /app/entrypoint.sh
24
+
25
  # Switch back to the original user
26
+ RUN useradd -m -u 1000 user
27
+ USER user
28
 
29
+ # Set environment variables for user
30
+ ENV HOME=/home/user
31
+ ENV PATH=/home/user/.local/bin:$PATH
32
 
33
+ # Set the working directory for the user
34
+ WORKDIR $HOME/app
35
 
36
  # Expose the port 8888 for JupyterLab
37
  EXPOSE 8888
 
44
  ENV JUPYTERLAB_TOKEN=your_secret_token
45
  ENV NGINX_PORT=7860
46
 
 
 
 
 
47
  # Run the entrypoint script when the container starts
48
  ENTRYPOINT ["/app/entrypoint.sh"]