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

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ UNKNOWN.egg-info/
process_models/ process_models/
.ipynb_checkpoints .ipynb_checkpoints
.env* .env*
.cache

View File

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

View File

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

View File

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

View File

@ -5,15 +5,11 @@ WORKDIR /app
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y -q \ && apt-get install -y -q \
gcc libssl-dev libpq-dev default-libmysqlclient-dev \ 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 --upgrade pip
RUN pip install poetry==1.8.1 pytest-xdist==3.5.0 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"] CMD ["./bin/run_server_locally"]

View File

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