Dev containers now work with "run as me" (#1129)

This commit is contained in:
jbirddog 2024-02-29 05:27:06 -05:00 committed by GitHub
parent b2126e8f38
commit bb3a685138
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 22 additions and 23 deletions

3
.gitignore vendored
View File

@ -8,4 +8,5 @@ version_info.json
UNKNOWN.egg-info/
process_models/
.ipynb_checkpoints
.env*
.env*
.cache

View File

@ -29,7 +29,7 @@ all: dev-env start-dev run-pyl
build-images:
$(DOCKER_COMPOSE) build
dev-env: stop-dev build-images fe-npm-i be-recreate-db
dev-env: stop-dev build-images poetry-i be-poetry-i be-recreate-db fe-npm-i
@/bin/true
start-dev: stop-dev
@ -47,6 +47,9 @@ be-logs:
be-mypy:
$(IN_BACKEND) poetry run mypy src tests
be-poetry-i:
$(IN_BACKEND) poetry install
be-recreate-db:
$(IN_BACKEND) ./bin/recreate_db clean
@ -74,6 +77,9 @@ fe-npm-i:
fe-sh:
$(IN_FRONTEND) /bin/bash
poetry-i:
$(IN_ARENA) poetry install --no-root
pre-commit:
$(IN_ARENA) poetry run pre-commit run --verbose --all-files
@ -88,7 +94,7 @@ take-ownership:
.PHONY: build-images dev-env \
start-dev stop-dev \
be-clear-log-file be-logs be-mypy be-recreate-db be-ruff be-sh be-tests be-tests-par \
be-clear-log-file be-logs be-mypy be-poetry-i be-recreate-db be-ruff be-sh be-tests be-tests-par \
fe-lint-fix fe-logs fe-npm-i fe-sh \
pre-commit run-pyl \
poetry-i pre-commit run-pyl \
take-ownership

View File

@ -10,7 +10,4 @@ RUN apt-get update \
RUN git config --global --add safe.directory /app
RUN pip install --upgrade pip
RUN pip install poetry==1.6.1
COPY pyproject.toml poetry.lock .
RUN poetry install --no-root
RUN pip install poetry==1.8.1

View File

@ -4,9 +4,9 @@ services:
build:
context: .
dockerfile: dev.Dockerfile
#
# TODO: would like to figure out the permissions issue that is preventing this
#
#user: "${RUN_AS}"
user: "${RUN_AS}"
environment:
POETRY_VIRTUALENVS_IN_PROJECT: "true"
PRE_COMMIT_HOME: "/app/.cache/pre-commit"
volumes:
- ./:/app

View File

@ -5,15 +5,11 @@ WORKDIR /app
RUN apt-get update \
&& apt-get install -y -q \
gcc libssl-dev libpq-dev default-libmysqlclient-dev \
pkg-config libffi-dev git-core curl
pkg-config libffi-dev git-core curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip install poetry==1.8.1 pytest-xdist==3.5.0
COPY pyproject.toml poetry.lock .
RUN poetry install --no-root
COPY ./ ./
RUN poetry install --only-root
CMD ["./bin/run_server_locally"]

View File

@ -4,12 +4,11 @@ services:
build:
context: spiffworkflow-backend
dockerfile: dev.Dockerfile
#
# TODO: would like to figure out the permissions issue that is preventing this
#
#user: "${RUN_AS}"
user: "${RUN_AS}"
environment:
FLASK_DEBUG: "1"
POETRY_VIRTUALENVS_IN_PROJECT: "true"
POETRY_CACHE_DIR: "/app/.cache/poetry"
SPIFFWORKFLOW_BACKEND_DATABASE_URI: ""
SPIFFWORKFLOW_BACKEND_ENV: "local_development"
SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA: ""