Files
schafkop-neu/frontend/Dockerfile
Valentin Heiserer 46899ef7be feat: integrate Tailwind CSS for improved styling and layout
- Added Tailwind CSS and its Vite plugin to the frontend project.
- Updated App.svelte to enhance UI with Tailwind classes, including a new layout for the serial monitor and command tester.
- Improved logging functionality by increasing log history and adding more detailed log messages.
- Refactored SendBox.svelte for consistent styling with Tailwind.
- Enhanced Pico firmware to support structured event logging and command parsing.
- Updated README_PICO_SERIAL.md to provide comprehensive documentation on serial communication and backend integration.
- Added .dockerignore to optimize Docker builds by excluding unnecessary files.
2025-08-30 14:18:57 +02:00

49 lines
1.3 KiB
Docker

######## Combined Frontend + Backend build (single Node runtime) ########
# This Dockerfile now builds BOTH the Svelte frontend and the NestJS backend
# and serves the compiled frontend through the backend (Express static).
########################
# 1) Frontend build #
########################
FROM node:20-bookworm-slim AS frontend-build
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm install --no-audit --no-fund
COPY frontend/ .
RUN npm run build
########################
# 2) Backend build #
########################
FROM node:20-bookworm-slim AS backend-build
WORKDIR /app
COPY backend/package*.json ./
RUN npm install --no-audit --no-fund
COPY backend/ .
# Copy compiled frontend into backend/public (served statically by Nest)
COPY --from=frontend-build /frontend/dist ./public
RUN npm run build
########################
# 3) Production image #
########################
FROM node:20-bookworm-slim AS runner
ENV NODE_ENV=production
WORKDIR /app
# Install only production deps (reuse original package.json)
COPY backend/package*.json ./
RUN npm install --omit=dev --no-audit --no-fund
# Copy backend dist + public assets
COPY --from=backend-build /app/dist ./dist
COPY --from=backend-build /app/public ./public
# Environment (override at runtime as needed)
ENV PORT=3000 \
SERIAL_BAUD=115200
EXPOSE 3000
CMD ["node", "dist/main.js"]