Skip to content

Commit

Permalink
Fix make file and docker to use 1 worker
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 committed Sep 5, 2024
1 parent c294e66 commit ebac4b3
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 23 deletions.
4 changes: 1 addition & 3 deletions bcol-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,14 @@ COPY --chown=web:web ./README.md /code
# Project initialization:
RUN --mount=type=cache,target="$POETRY_CACHE_DIR" \
echo "$APP_ENV" \
&& poetry config installer.max-workers 1 \
&& poetry version \
# Install deps:
&& poetry run pip install -U pip \
&& poetry install \
$(if [ -z ${APP_ENV+x} ] | [ "$APP_ENV" = 'production' ]; then echo '--only main'; fi) \
--no-interaction --no-ansi

# Concurrent fix until poetry 1.8.3+ is released
RUN curl https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py -o /usr/local/venv/lib/python3.12/site-packages/poetry/installation/executor.py

# Running as non-root user:
USER web

Expand Down
2 changes: 1 addition & 1 deletion bcol-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ clean-test: ## clean test files
install: clean
unset HOME ## unset HOME because it's in the DEV .env file, will cause permissions issues
pip install poetry ;\
python -c "import site; import urllib.request; url = 'https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py'; file_name = site.getsitepackages()[0] + '/poetry/installation/executor.py'; print('Poetry 1.8.3 fix - Copying ' + url + ' to ' + file_name); urllib.request.urlretrieve(url, file_name)"
poetry config installer.max-workers 1
poetry install

#################################################################################
Expand Down
4 changes: 1 addition & 3 deletions jobs/ftp-poller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,12 @@ COPY --chown=web:web ./poetry.lock ./pyproject.toml .
RUN --mount=type=cache,target="$POETRY_CACHE_DIR" \
echo "$APP_ENV" \
&& poetry version \
&& poetry config installer.max-workers 1 \
&& poetry run pip install -U pip \
&& poetry install \
$(if [ -z ${APP_ENV+x} ] | [ "$APP_ENV" = 'production' ]; then echo '--only main'; fi) \
--no-interaction --no-ansi

# Concurrent fix until poetry 1.8.3+ is released
RUN curl https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py -o /usr/local/venv/lib/python3.12/site-packages/poetry/installation/executor.py

COPY . .


Expand Down
2 changes: 1 addition & 1 deletion jobs/ftp-poller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ clean-test: ## clean test files
install: clean
unset HOME ## unset HOME because it's in the DEV .env file, will cause permissions issues
pip install poetry ;\
python -c "import site; import urllib.request; url = 'https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py'; file_name = site.getsitepackages()[0] + '/poetry/installation/executor.py'; print('Poetry 1.8.3 fix - Copying ' + url + ' to ' + file_name); urllib.request.urlretrieve(url, file_name)"
poetry config installer.max-workers 1
poetry install

#################################################################################
Expand Down
4 changes: 1 addition & 3 deletions jobs/payment-jobs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ COPY --chown=web:web ./poetry.lock ./pyproject.toml .
RUN --mount=type=cache,target="$POETRY_CACHE_DIR" \
echo "$APP_ENV" \
&& poetry version \
&& poetry config installer.max-workers 1 \
&& poetry run pip install -U pip \
&& poetry install \
$(if [ -z ${APP_ENV+x} ] | [ "$APP_ENV" = 'production' ]; then echo '--only main'; fi) \
--no-interaction --no-ansi

# Concurrent fix until poetry 1.8.3+ is released
RUN curl https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py -o /usr/local/venv/lib/python3.12/site-packages/poetry/installation/executor.py

COPY . .
# Set ownership and permissions
# Set scripts as executable (make files and python files do not have to be marked)
Expand Down
2 changes: 1 addition & 1 deletion jobs/payment-jobs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ clean-test: ## clean test files

install: clean
pip install poetry ;\
python -c "import site; import urllib.request; url = 'https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py'; file_name = site.getsitepackages()[0] + '/poetry/installation/executor.py'; print('Poetry 1.8.3 fix - Copying ' + url + ' to ' + file_name); urllib.request.urlretrieve(url, file_name)"
poetry config installer.max-workers 1
poetry install

#################################################################################
Expand Down
4 changes: 1 addition & 3 deletions pay-admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,13 @@ COPY --chown=web:web ./README.md /code
RUN --mount=type=cache,target="$POETRY_CACHE_DIR" \
echo "$APP_ENV" \
&& poetry version \
&& poetry config installer.max-workers 1 \
# Install deps:
&& poetry run pip install -U pip \
&& poetry install \
$(if [ -z ${APP_ENV+x} ] | [ "$APP_ENV" = 'production' ]; then echo '--only main'; fi) \
--no-interaction --no-ansi

# Concurrent fix until poetry 1.8.3+ is released
RUN curl https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py -o /usr/local/venv/lib/python3.12/site-packages/poetry/installation/executor.py

# Running as non-root user:
USER web

Expand Down
1 change: 1 addition & 0 deletions pay-admin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ clean-test: ## clean test files
install: clean
unset HOME ## unset HOME because it's in the DEV .env file, will cause permissions issues
pip install poetry ;\
poetry config installer.max-workers 1
poetry install

#################################################################################
Expand Down
6 changes: 2 additions & 4 deletions pay-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,13 @@ COPY --chown=web:web ./README.md /code
RUN --mount=type=cache,target="$POETRY_CACHE_DIR" \
echo "$APP_ENV" \
&& poetry version \
&& poetry config installer.max-workers 1 \
# Install deps:
&& poetry run pip install -U pip \
&& poetry install \
$(if [ -z ${APP_ENV+x} ] | [ "$APP_ENV" = 'production' ]; then echo '--only main'; fi) \
--no-interaction --no-ansi

# Concurrent fix until poetry 1.8.3+ is released
RUN curl https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py -o /usr/local/venv/lib/python3.12/site-packages/poetry/installation/executor.py


# Running as non-root user:
USER web

Expand Down
2 changes: 1 addition & 1 deletion pay-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ clean-test: ## clean test files

install: clean
pip install poetry ;\
python -c "import site; import urllib.request; url = 'https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py'; file_name = site.getsitepackages()[0] + '/poetry/installation/executor.py'; print('Poetry 1.8.3 fix - Copying ' + url + ' to ' + file_name); urllib.request.urlretrieve(url, file_name)"
poetry config installer.max-workers 1
poetry install

#################################################################################
Expand Down
4 changes: 1 addition & 3 deletions pay-queue/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,13 @@ COPY --chown=web:web ./README.md /code
RUN --mount=type=cache,target="$POETRY_CACHE_DIR" \
echo "$APP_ENV" \
&& poetry version \
&& poetry config installer.max-workers 1 \
# Install deps:
&& poetry run pip install -U pip \
&& poetry install \
$(if [ -z ${APP_ENV+x} ] | [ "$APP_ENV" = 'production' ]; then echo '--only main'; fi) \
--no-interaction --no-ansi

# Concurrent fix until poetry 1.8.3+ is released
RUN curl https://gist.githubusercontent.com/seeker25/0dd67670f738f1dc2bc24a885ab78914/raw/a858698a81d7b76efe6e1ec3ef9850ae3667f923/executor.py -o /usr/local/venv/lib/python3.12/site-packages/poetry/installation/executor.py

# Running as non-root user:
USER web

Expand Down

0 comments on commit ebac4b3

Please sign in to comment.