Skip to content

Commit

Permalink
Update docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Feb 2, 2024
1 parent 673c84e commit 30b58e7
Show file tree
Hide file tree
Showing 5 changed files with 3,077 additions and 854 deletions.
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# This dockerfile is used by binder.

FROM ghcr.io/mysociety/data_common:sha-54e0768
FROM ghcr.io/mysociety/data_common:sha-e3ee4f4

# 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/uk_local_authority_names_and_codes && touch /setup/src/uk_local_authority_names_and_codes/__init__.py \
&& touch /setup/src/data_common/__init__.py \
&& export PATH="$HOME/.poetry/bin:$PATH" \
COPY pyproject.toml poetry.loc[k] /setup/
COPY src/data_common/pyproject.toml src/data_common/poetry.loc[k] /setup/src/data_common/
ENV WORKSPACE_NAME uk_local_authority_names_and_codes
RUN mkdir /setup/src/$WORKSPACE_NAME \
&& touch /setup/src/$WORKSPACE_NAME/__init__.py \
&& mkdir --parents /setup/src/data_common/src/data_common \
&& touch /setup/src/data_common/src/data_common/__init__.py \
&& export PATH="/root/.local/bin:$PATH" \
&& cd /setup/ && poetry install \
&& echo "/workspaces/uk_local_authority_names_and_codes/src/" > /usr/local/lib/python3.10/site-packages/uk_local_authority_names_and_codes.pth \
&& echo "/workspaces/uk_local_authority_names_and_codes/src/data_common/src" > /usr/local/lib/python3.10/site-packages/data_common.pth
&& echo "/workspaces/$WORKSPACE_NAME/src/" > /usr/local/lib/python3.10/site-packages/$WORKSPACE_NAME.pth \
&& echo "/workspaces/$WORKSPACE_NAME/src/data_common/src" > /usr/local/lib/python3.10/site-packages/data_common.pth


# special binder instructions

Expand Down
11 changes: 6 additions & 5 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM ghcr.io/mysociety/data_common:sha-54e0768
FROM ghcr.io/mysociety/data_common:sha-e3ee4f4

# 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.loc[k] /setup/
COPY src/data_common/pyproject.toml src/data_common/poetry.loc[k] /setup/src/data_common/
RUN mkdir /setup/src/uk_local_authority_names_and_codes \
&& touch /setup/src/uk_local_authority_names_and_codes/__init__.py \
ENV WORKSPACE_NAME uk_local_authority_names_and_codes
RUN mkdir /setup/src/$WORKSPACE_NAME \
&& touch /setup/src/$WORKSPACE_NAME/__init__.py \
&& mkdir --parents /setup/src/data_common/src/data_common \
&& touch /setup/src/data_common/src/data_common/__init__.py \
&& export PATH="/root/.local/bin:$PATH" \
&& cd /setup/ && poetry install \
&& echo "/workspaces/uk_local_authority_names_and_codes/src/" > /usr/local/lib/python3.10/site-packages/uk_local_authority_names_and_codes.pth \
&& echo "/workspaces/uk_local_authority_names_and_codes/src/data_common/src" > /usr/local/lib/python3.10/site-packages/data_common.pth
&& echo "/workspaces/$WORKSPACE_NAME/src/" > /usr/local/lib/python3.10/site-packages/$WORKSPACE_NAME.pth \
&& echo "/workspaces/$WORKSPACE_NAME/src/data_common/src" > /usr/local/lib/python3.10/site-packages/data_common.pth
2 changes: 1 addition & 1 deletion docs/theme

0 comments on commit 30b58e7

Please sign in to comment.