-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (30 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
46 lines (30 loc) · 1.21 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM ubuntu:24.04 AS base
RUN apt-get update > /dev/null && \
apt-get install --yes python3 python3-pip python3-venv xfsprogs tini > /dev/null && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Create and activate virtual environment
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
COPY ./pyproject.toml /opt/jupyterhub-home-nfs/pyproject.toml
COPY ./README.md /opt/jupyterhub-home-nfs/README.md
WORKDIR /opt/jupyterhub-home-nfs
ENTRYPOINT ["tini", "--"]
# Development stage
FROM base AS dev
COPY dev-scripts/mount-xfs.sh /usr/local/bin/mount-xfs.sh
RUN chmod +x /usr/local/bin/mount-xfs.sh
COPY dev-scripts/start.sh /usr/local/bin/start.sh
RUN chmod +x /usr/local/bin/start.sh
RUN pip install pytest
COPY ./jupyterhub_home_nfs /opt/jupyterhub-home-nfs/jupyterhub_home_nfs
RUN pip install -e .
CMD ["/bin/bash", "/usr/local/bin/start.sh"]
# Production stage
FROM base AS prod
COPY ./jupyterhub_home_nfs /opt/jupyterhub-home-nfs/jupyterhub_home_nfs
RUN pip install -e .
# Don't buffer output, so all error logs get flushed immediately
# Without this, exceptions may get swallowed sometime
ENV PYTHONUNBUFFERED=1
CMD ["python", "-m", "jupyterhub_home_nfs.generate"]