made changes to compose

This commit is contained in:
Jake Kasper
2025-09-02 07:18:31 -05:00
parent 4853eff749
commit 4476c6f6f7
2 changed files with 19 additions and 1 deletions

View File

@@ -11,11 +11,19 @@ services:
build:
context: ./frontend
dockerfile: Dockerfile
command: >-
sh -lc "
if [ ! -d node_modules ] || [ -z \"$(ls -A node_modules 2>/dev/null)\" ]; then
echo '[frontend] Installing dependencies...';
npm install --silent;
fi;
npm start
"
environment:
- REACT_APP_API_URL=https://turftracker.kaspers.us/api
volumes:
- ./frontend:/app
- /app/node_modules
- frontend_node_modules:/app/node_modules
depends_on:
- backend
networks:
@@ -35,6 +43,14 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
command: >-
sh -lc "
if [ ! -d node_modules ] || [ -z \"$(ls -A node_modules 2>/dev/null)\" ]; then
echo '[backend] Installing production dependencies...';
npm install --only=production --silent;
fi;
npm start
"
environment:
- NODE_ENV=development
- DB_HOST=db
@@ -99,3 +115,5 @@ services:
volumes:
postgres_data:
frontend_node_modules:
backend_node_modules: