Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker build #801

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
# Postgres
db:
Expand Down
10 changes: 7 additions & 3 deletions docker/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ RUN pip install --no-cache-dir \
FROM base AS app

# Install envkey-source
RUN curl -s https://raw.githubusercontent.com/envkey/envkey-source/master/install.sh | bash
RUN set -ex && apk add --no-cache sudo \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you set the docker user to root rather than using sudo?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah... it probably explicitly invokes sudo... sure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't call USER at all in this file, so I'd assumed the user is already root (but I didn't check!)

&& curl -s https://raw.githubusercontent.com/envkey/envkey-source/master/install.sh | bash \
&& apk del sudo

# Install and set up Poetry for python dependencies management
ENV POETRY_VIRTUALENVS_CREATE=0 \
Expand Down Expand Up @@ -125,8 +127,10 @@ COPY ./app/pyproject.toml /usr/srv/app/pyproject.toml
COPY ./app/poetry.lock /usr/srv/app/poetry.lock
## self update disabled currently due to causing timeout issues in the deploy
#RUN $HOME/.local/bin/poetry self update 1.2.2 && \
RUN $HOME/.local/bin/poetry install

RUN mkdir -p $HOME/.poetry \
&& touch $HOME/.poetry/env \
&& $HOME/.local/bin/poetry install \
&& ln -s $HOME/.local/bin/poetry /usr/local/bin/poetry

VOLUME /usr/srv/app/media

Expand Down
2 changes: 1 addition & 1 deletion script/cibuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -e

docker-compose -f docker-compose.test.yml run --rm test
docker compose -f docker-compose.test.yml run --rm test