-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.local
More file actions
29 lines (23 loc) · 1.19 KB
/
Dockerfile.local
File metadata and controls
29 lines (23 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM python:3.12
USER root
# Install the dependencies (using uv)
COPY ./works/requirements.txt .
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
RUN uv pip install --system --no-cache-dir -r requirements.txt
# sudoer settings
RUN chsh -s /bin/bash
RUN useradd jovyan -d /home/jovyan -m -p 0049e6b11c44d4b00006eb820983a7a76c84a12d -s /bin/bash && \
echo "jovyan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
chmod -R 755 /usr/local/share/jupyter && \
usermod -u 1100 jovyan && groupmod -g 3000 jovyan && \
jupyter server --generate-config && \
mkdir -p /home/jovyan/work
# Enable the Content Security Policy to allow iframe embedding.
COPY --from=public.ecr.aws/deeplearning-ai/public-courses:utils-V1 /home/jovyan/.jupyter/jupyter_server_config.py /home/jovyan/.jupyter/jupyter_server_config.py
COPY ./works /home/jovyan/work
# Ensure read/write for jovyan
RUN chown -R jovyan:jovyan -R /home/jovyan
RUN chown -R jovyan:jovyan -R /home/jovyan/work
RUN curl -L https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 -o /usr/local/bin/ttyd && chmod +x /usr/local/bin/ttyd
USER jovyan
CMD ["bash", "-c", "ttyd -p 7682 -W bash & jupyter lab --ip=0.0.0.0 --no-browser --allow-root"]