docker compose overlay file for editable frontend container (#1092)

This commit is contained in:
jbirddog 2024-02-22 19:31:55 -05:00 committed by GitHub
parent 154d0aed87
commit 718d27ca5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 46 additions and 0 deletions

26
Makefile Normal file
View File

@ -0,0 +1,26 @@
FRONTEND_CONTAINER ?= spiffworkflow-frontend
FRONTEND_DEV_OVERLAY ?= spiffworkflow-frontend/dev.docker-compose.yml
dev-env:
docker compose -f docker-compose.yml \
-f $(FRONTEND_DEV_OVERLAY) \
build
start-dev:
docker compose -f docker-compose.yml \
-f $(FRONTEND_DEV_OVERLAY) \
up -d
stop-dev:
docker compose -f docker-compose.yml \
-f $(FRONTEND_DEV_OVERLAY) \
down
fe-lint-fix:
docker exec -it $(FRONTEND_CONTAINER) npm run lint:fix
fe-sh:
docker exec -it $(FRONTEND_CONTAINER) /bin/bash
.PHONY: dev-env start-dev stop-dev \
fe-lint-fix fe-sh

View File

@ -0,0 +1,9 @@
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"]

View File

@ -0,0 +1,10 @@
services:
spiffworkflow-frontend:
build:
context: spiffworkflow-frontend
dockerfile: dev.Dockerfile
environment:
HOST: "0.0.0.0"
PORT: "${SPIFFWORKFLOW_FRONTEND_PORT:-8001}"
volumes:
- ./spiffworkflow-frontend:/app

View File

@ -66,6 +66,7 @@
},
"scripts": {
"start": "ESLINT_NO_DEV_ERRORS=true PORT=7001 craco start",
"docker:start": "ESLINT_NO_DEV_ERRORS=true craco start",
"build": "craco build",
"test": "react-scripts test --coverage",
"t": "npm test -- --watchAll=false",