fix reloads
This commit is contained in:
@@ -13,6 +13,10 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
environment:
|
environment:
|
||||||
- REACT_APP_API_URL=https://turftracker.kaspers.us/api
|
- REACT_APP_API_URL=https://turftracker.kaspers.us/api
|
||||||
|
- CHOKIDAR_USEPOLLING=true
|
||||||
|
- WATCHPACK_POLLING=true
|
||||||
|
- WDS_SOCKET_PORT=443
|
||||||
|
- DANGEROUSLY_DISABLE_HOST_CHECK=true
|
||||||
volumes:
|
volumes:
|
||||||
- ./frontend:/app
|
- ./frontend:/app
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
|
|||||||
@@ -1,21 +1,26 @@
|
|||||||
|
###
|
||||||
|
### Frontend development image (hot reload)
|
||||||
|
### Runs CRA dev server for fast iteration behind Traefik
|
||||||
|
###
|
||||||
|
|
||||||
FROM node:18-alpine
|
FROM node:18-alpine
|
||||||
|
|
||||||
# Set working directory
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files and install dependencies
|
# Install dependencies
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install --silent
|
RUN npm install --silent
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Expose port
|
# Dev-friendly env for Docker volumes
|
||||||
|
ENV CHOKIDAR_USEPOLLING=true \
|
||||||
|
WATCHPACK_POLLING=true \
|
||||||
|
WDS_SOCKET_PORT=0 \
|
||||||
|
DANGEROUSLY_DISABLE_HOST_CHECK=true
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Health check using Node.js script
|
# Start CRA dev server (HMR)
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
||||||
CMD node healthcheck.js
|
|
||||||
|
|
||||||
# Start the application
|
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
"typescript": "^4.9.5"
|
"typescript": "^4.9.5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "DANGEROUSLY_DISABLE_HOST_CHECK=true WDS_SOCKET_PORT=0 react-scripts start",
|
"start": "react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
@@ -62,6 +62,5 @@
|
|||||||
"last 1 firefox version",
|
"last 1 firefox version",
|
||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
"proxy": "http://backend:5000"
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user