From 52f986ffe2d4a94c7bbc665d69f8ce9e390becf4 Mon Sep 17 00:00:00 2001 From: jbirddog <100367399+jbirddog@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:49:45 -0500 Subject: [PATCH] Dev Container Tweaks (#1117) --- .gitignore | 1 + Makefile | 6 +++--- README.md | 2 +- docker-compose.yml | 2 +- spiffworkflow-backend/Dockerfile | 2 +- spiffworkflow-backend/dev.Dockerfile | 2 +- spiffworkflow-frontend/dev.Dockerfile | 4 ---- 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index af933b20..5b7e9798 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ version_info.json UNKNOWN.egg-info/ process_models/ .ipynb_checkpoints +.env* \ No newline at end of file diff --git a/Makefile b/Makefile index b35ce5fa..64765e48 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ all: dev-env start-dev run-pyl build-images: $(DOCKER_COMPOSE) build -dev-env: build-images fe-npm-i be-recreate-db +dev-env: stop-dev build-images fe-npm-i be-recreate-db @/bin/true start-dev: stop-dev @@ -69,7 +69,7 @@ fe-logs: docker logs -f $(FRONTEND_CONTAINER) fe-npm-i: - $(IN_FRONTEND) npm i + $(IN_FRONTEND) npm i && git checkout -- spiffworkflow-frontend/package-lock.json fe-sh: $(IN_FRONTEND) /bin/bash @@ -88,7 +88,7 @@ take-ownership: .PHONY: build-images dev-env \ start-dev stop-dev \ - be-clear-log-file be-logs be-recreate-db be-ruff be-sh be-tests be-tests-par \ + be-clear-log-file be-logs be-mypy 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 \ take-ownership diff --git a/README.md b/README.md index a842e95d..a0282551 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ If you have `docker` and `docker compose`, as an alternative to locally installi After the containers are set up, you can run `make start-dev` and `make stop-dev` to start and stop the servers. If the frontend or backend lock file changes, `make dev-env` will recreate the containers with the new dependencies. -Please refer to the [Makefile](Makefile) as the source of truth, but for a summary of the available `make` targets. +Please refer to the [Makefile](Makefile) as the source of truth, but for a summary of the available `make` targets: | Target | Action | |----|----| diff --git a/docker-compose.yml b/docker-compose.yml index b136cb58..4238f6be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,7 +41,7 @@ services: ports: - "${SPIFF_BACKEND_PORT:-8000}:${SPIFF_BACKEND_PORT:-8000}/tcp" volumes: - - ./process_models:/app/process_models + - ${SPIFFWORKFLOW_BACKEND_LOCAL_BPMN_SPEC_DIR:-./process_models}:/app/process_models - spiffworkflow_backend_db:/app/db_volume healthcheck: test: "curl localhost:${SPIFF_BACKEND_PORT:-8000}/v1.0/status --fail" diff --git a/spiffworkflow-backend/Dockerfile b/spiffworkflow-backend/Dockerfile index 8af14144..fec35803 100644 --- a/spiffworkflow-backend/Dockerfile +++ b/spiffworkflow-backend/Dockerfile @@ -27,7 +27,7 @@ RUN apt-get update \ # keep pip up to date RUN pip install --upgrade pip -RUN pip install poetry==1.6.1 +RUN pip install poetry==1.8.1 ######################## - SETUP diff --git a/spiffworkflow-backend/dev.Dockerfile b/spiffworkflow-backend/dev.Dockerfile index 72e20f11..64bfc759 100644 --- a/spiffworkflow-backend/dev.Dockerfile +++ b/spiffworkflow-backend/dev.Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update \ pkg-config libffi-dev git-core curl RUN pip install --upgrade pip -RUN pip install poetry==1.6.1 pytest-xdist +RUN pip install poetry==1.8.1 pytest-xdist==3.5.0 COPY pyproject.toml poetry.lock . RUN poetry install --no-root diff --git a/spiffworkflow-frontend/dev.Dockerfile b/spiffworkflow-frontend/dev.Dockerfile index b174a86f..758caa06 100644 --- a/spiffworkflow-frontend/dev.Dockerfile +++ b/spiffworkflow-frontend/dev.Dockerfile @@ -2,8 +2,4 @@ FROM node:20.8.1-bookworm-slim AS base WORKDIR /app -COPY package.json package-lock.json . - -RUN npm i - CMD ["npm", "run", "docker:start"]