generated from mysociety/python-data-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (27 loc) · 1.22 KB
/
Dockerfile
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
# This dockerfile is used by binder.
FROM ghcr.io/mysociety/data_common:sha-a3b8e93
# Make an empty project directory so the 'self' setup doesn't fail and scripts can be setup
# Override the .pth created at previous stages to point to where the working directory will land
COPY pyproject.toml poetry.lock /setup/
COPY src/data_common/pyproject.toml src/data_common/poetry.lock /setup/src/data_common/
RUN mkdir /setup/src/parl_register_interests && touch /setup/src/parl_register_interests/__init__.py \
&& touch /setup/src/data_common/__init__.py \
&& export PATH="$HOME/.poetry/bin:$PATH" \
&& cd /setup/ && poetry install \
&& echo "/workspaces/parl_register_interests/src/" > /usr/local/lib/python3.10/site-packages/parl_register_interests.pth \
&& echo "/workspaces/parl_register_interests/src/data_common/src" > /usr/local/lib/python3.10/site-packages/data_common.pth
# special binder instructions
RUN pip install --no-cache-dir notebook
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}