Modern ERP Reports Application with microservices architecture Tech Stack: - Backend: FastAPI + python-oracledb (Oracle DB integration) - Frontend: Vue.js 3 + PrimeVue + Vite - Telegram Bot: python-telegram-bot + SQLite - Infrastructure: Shared database pool, JWT authentication, SSH tunnel Features: - FastAPI backend with async Oracle connection pool - Vue.js 3 responsive frontend with PrimeVue components - Telegram bot alternative interface - Microservices architecture with shared components - Complete deployment support (Linux Docker + Windows IIS) - Comprehensive testing (Playwright E2E + pytest) Repository Structure: - reports-app/ - Main application (backend, frontend, telegram-bot) - shared/ - Shared components (database pool, auth, utils) - deployment/ - Deployment scripts (Linux & Windows) - docs/ - Project documentation - security/ - Security scanning and git hooks
55 lines
1.4 KiB
Docker
55 lines
1.4 KiB
Docker
# Multi-stage build for Vue.js frontend with Nginx
|
|
# Stage 1: Build the Vue.js application
|
|
FROM node:18-alpine as builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies first for better caching
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
# Copy source code and build
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve with optimized Nginx
|
|
FROM nginx:1.25-alpine as production
|
|
|
|
# Install security packages
|
|
RUN apk add --no-cache \
|
|
tini \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1001 -S appuser && \
|
|
adduser -S -D -H -u 1001 -h /var/cache/nginx -s /sbin/nologin -G appuser appuser
|
|
|
|
# Copy built application from builder
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Copy custom Nginx configuration
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Fix permissions
|
|
RUN chown -R appuser:appuser /var/cache/nginx && \
|
|
chown -R appuser:appuser /var/log/nginx && \
|
|
chown -R appuser:appuser /etc/nginx/conf.d && \
|
|
touch /var/run/nginx.pid && \
|
|
chown -R appuser:appuser /var/run/nginx.pid && \
|
|
chown -R appuser:appuser /usr/share/nginx/html
|
|
|
|
# Switch to non-root user
|
|
USER appuser
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Use tini as init system
|
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
|
|
# Start Nginx
|
|
CMD ["nginx", "-g", "daemon off;"] |