fix: use docker compose watch under dev
All checks were successful
Deploy to Production / deploy (push) Successful in 1m12s
All checks were successful
Deploy to Production / deploy (push) Successful in 1m12s
This commit is contained in:
7
.env
7
.env
@@ -43,3 +43,10 @@ SENTRY_DSN=
|
|||||||
# Configure these with your own Docker registry images
|
# Configure these with your own Docker registry images
|
||||||
DOCKER_IMAGE_BACKEND=backend
|
DOCKER_IMAGE_BACKEND=backend
|
||||||
DOCKER_IMAGE_FRONTEND=frontend
|
DOCKER_IMAGE_FRONTEND=frontend
|
||||||
|
|
||||||
|
# MQTT Config
|
||||||
|
MQTT_HOST=101.35.119.226
|
||||||
|
MQTT_PORT=1883
|
||||||
|
MQTT_USERNAME=weefnn
|
||||||
|
MQTT_PASSWORD=123456
|
||||||
|
MQTT_CLIENT_ID=spatialhub-local-dev-weifeng
|
||||||
|
|||||||
@@ -114,9 +114,31 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: frontend/Dockerfile
|
dockerfile: frontend/Dockerfile
|
||||||
|
target: dev-stage
|
||||||
args:
|
args:
|
||||||
- VITE_API_URL=http://localhost:8000
|
- VITE_API_URL=http://localhost:8000
|
||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
|
environment:
|
||||||
|
- VITE_API_URL=http://localhost:8000
|
||||||
|
- CHOKIDAR_USEPOLLING=true
|
||||||
|
- CHOKIDAR_INTERVAL=150
|
||||||
|
develop:
|
||||||
|
watch:
|
||||||
|
- path: ./frontend
|
||||||
|
action: sync
|
||||||
|
target: /app/frontend
|
||||||
|
ignore:
|
||||||
|
- node_modules/
|
||||||
|
- dist/
|
||||||
|
- blob-report/
|
||||||
|
- test-results/
|
||||||
|
- package.json
|
||||||
|
- path: ./frontend/package.json
|
||||||
|
action: rebuild
|
||||||
|
- path: ./package.json
|
||||||
|
action: rebuild
|
||||||
|
- path: ./bun.lock
|
||||||
|
action: rebuild
|
||||||
|
|
||||||
playwright:
|
playwright:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
# Stage 0, "build-stage", based on Bun, to build and compile the frontend
|
# Shared Bun stage for frontend dependencies and sources
|
||||||
FROM oven/bun:1 AS build-stage
|
FROM oven/bun:1 AS bun-base
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json bun.lock /app/
|
COPY package.json bun.lock /app/
|
||||||
|
|
||||||
COPY frontend/package.json /app/frontend/
|
COPY frontend/package.json /app/frontend/
|
||||||
|
|
||||||
WORKDIR /app/frontend
|
WORKDIR /app/frontend
|
||||||
@@ -14,10 +13,22 @@ RUN bun install
|
|||||||
COPY ./frontend /app/frontend
|
COPY ./frontend /app/frontend
|
||||||
ARG VITE_API_URL
|
ARG VITE_API_URL
|
||||||
|
|
||||||
|
|
||||||
|
# Development stage for docker compose watch + Vite HMR
|
||||||
|
FROM bun-base AS dev-stage
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
CMD ["bun", "run", "dev", "--host", "0.0.0.0", "--port", "80"]
|
||||||
|
|
||||||
|
|
||||||
|
# Build stage for production assets
|
||||||
|
FROM bun-base AS build-stage
|
||||||
|
|
||||||
RUN bun run build
|
RUN bun run build
|
||||||
|
|
||||||
|
|
||||||
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
|
# Production stage serving compiled assets with Nginx
|
||||||
FROM nginx:1
|
FROM nginx:1
|
||||||
|
|
||||||
COPY --from=build-stage /app/frontend/dist/ /usr/share/nginx/html
|
COPY --from=build-stage /app/frontend/dist/ /usr/share/nginx/html
|
||||||
|
|||||||
Reference in New Issue
Block a user