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: build:
context: ./frontend context: ./frontend
dockerfile: Dockerfile 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: environment:
- REACT_APP_API_URL=https://turftracker.kaspers.us/api - REACT_APP_API_URL=https://turftracker.kaspers.us/api
volumes: volumes:
- ./frontend:/app - ./frontend:/app
- /app/node_modules - frontend_node_modules:/app/node_modules
depends_on: depends_on:
- backend - backend
networks: networks:
@@ -35,6 +43,14 @@ services:
build: build:
context: ./backend context: ./backend
dockerfile: Dockerfile 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: environment:
- NODE_ENV=development - NODE_ENV=development
- DB_HOST=db - DB_HOST=db
@@ -99,3 +115,5 @@ services:
volumes: volumes:
postgres_data: postgres_data:
frontend_node_modules:
backend_node_modules:

0
scripts/deploy.sh Normal file → Executable file
View File