feat: initialize frontend with React, Vite, and Tailwind CSS
- Added package.json for project dependencies and scripts. - Configured PostCSS with Tailwind CSS. - Created main application structure with App component and routing. - Implemented API client for handling requests with Axios. - Developed authentication API for login, logout, and user verification. - Created entities API for managing virtual entities. - Implemented logs API for fetching dispatch logs. - Added navigation bar component for app navigation. - Created protected route component for route guarding. - Set up global CSS with Tailwind directives. - Configured main entry point for React application. - Developed basic Dashboard and Login pages. - Set up router for application navigation. - Added Jest testing setup for testing library. - Configured Tailwind CSS with content paths. - Set TypeScript configuration for frontend. - Created Vite configuration for development and production builds. - Added Nginx configuration for serving the application and proxying API requests.
This commit is contained in:
58
Dockerfile.allinone
Normal file
58
Dockerfile.allinone
Normal file
@@ -0,0 +1,58 @@
|
||||
# ── Stage 1: Build frontend ───────────────────────────────────────────────────
|
||||
FROM node:20-alpine AS frontend-build
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
# ── Stage 2: Build backend ────────────────────────────────────────────────────
|
||||
FROM gradle:8-jdk21-alpine AS backend-build
|
||||
|
||||
WORKDIR /app/backend
|
||||
|
||||
COPY backend/build.gradle.kts backend/settings.gradle.kts ./
|
||||
COPY backend/gradle ./gradle
|
||||
RUN gradle dependencies --no-daemon --quiet || true
|
||||
|
||||
COPY backend/src ./src
|
||||
RUN gradle bootJar --no-daemon -x test
|
||||
|
||||
# ── Stage 3: Final all-in-one image ───────────────────────────────────────────
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
nginx \
|
||||
postgresql \
|
||||
supervisor \
|
||||
openjdk-21-jre-headless \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# PostgreSQL data directory
|
||||
RUN mkdir -p /var/lib/postgresql/data && chown -R postgres:postgres /var/lib/postgresql
|
||||
|
||||
# Copy frontend static files
|
||||
COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html
|
||||
|
||||
# Copy backend JAR
|
||||
RUN mkdir -p /app
|
||||
COPY --from=backend-build /app/backend/build/libs/*.jar /app/app.jar
|
||||
|
||||
# Copy Nginx config (internal — backend is on localhost:8080)
|
||||
COPY nginx/nginx.allinone.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Copy Supervisor config
|
||||
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# Copy entrypoint
|
||||
COPY docker/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user