eafc1c33fc
- FastAPI backend with SQLite database - React + TailwindCSS frontend - JWT authentication - Excel upload/download for attendance and accident records - Shift roster management with S7a/S7b split - Lateness/OT calculation based on shift times - Roster info API endpoints - Export API with token query parameter support - Docker compose deployment
41 lines
920 B
Docker
41 lines
920 B
Docker
FROM python:3.11-slim
|
|
|
|
# Install Node.js for frontend build + build deps for bcrypt
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
build-essential \
|
|
libffi-dev \
|
|
libssl-dev \
|
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
apt-get install -y nodejs && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy requirements first (for caching)
|
|
COPY backend/requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy backend code
|
|
COPY backend/ .
|
|
|
|
# Copy frontend source
|
|
COPY frontend/ ./frontend/
|
|
|
|
# Build frontend
|
|
RUN cd frontend && npm install && npm run build
|
|
|
|
# Move built frontend to static folder
|
|
RUN mkdir -p /app/static && mv frontend/dist/* /app/static/
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /app/data
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Run
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|