mirror of
https://github.com/DumbWareio/DumbDrop.git
synced 2025-11-02 21:13:40 +00:00
feat: Complete Application Infrastructure and Security Overhaul (#28)
Chores & Configuration • Enhanced development setup: optimized Dockerfile, refined scripts, and improved .gitignore. • Updated docker-compose for better dev/prod separation. • Improved documentation in README and source files. Features & Enhancements • Refactored project structure with modular architecture. • Improved testing infrastructure and integration tests. • Enhanced file upload logic, client-side handling, and API routes. • Implemented robust server shutdown, rate limiting, and cleanup mechanisms. • Improved upload progress tracking with UI enhancements. • Strengthened security in PIN authentication and cookie handling. Refactors & Fixes • Cleaned up test infrastructure, logging, and error handling. • Simplified API route paths and improved middleware. • Fixed incorrect total storage size reporting. • Optimized logging verbosity based on environment. Documentation • Expanded project documentation and comments for clarity.
This commit is contained in:
committed by
GitHub
parent
2ec69ba26e
commit
22f79f830b
56
Dockerfile
56
Dockerfile
@@ -1,26 +1,64 @@
|
||||
FROM node:18-alpine
|
||||
# Base stage for shared configurations
|
||||
FROM node:20-alpine as base
|
||||
|
||||
# Install python and create virtual environment
|
||||
# Install python and create virtual environment with minimal dependencies
|
||||
RUN apk add --no-cache python3 py3-pip && \
|
||||
python3 -m venv /opt/venv
|
||||
python3 -m venv /opt/venv && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
# Activate virtual environment and install apprise
|
||||
RUN . /opt/venv/bin/activate && \
|
||||
pip install --no-cache-dir apprise
|
||||
pip install --no-cache-dir apprise && \
|
||||
find /opt/venv -type d -name "__pycache__" -exec rm -r {} +
|
||||
|
||||
# Add virtual environment to PATH
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Dependencies stage
|
||||
FROM base as deps
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --only=production && \
|
||||
# Remove npm cache
|
||||
npm cache clean --force
|
||||
|
||||
RUN npm install
|
||||
# Development stage
|
||||
FROM deps as development
|
||||
ENV NODE_ENV=development
|
||||
|
||||
COPY . .
|
||||
# Install dev dependencies
|
||||
RUN npm install && \
|
||||
npm cache clean --force
|
||||
|
||||
RUN mkdir -p uploads
|
||||
# Create upload directories
|
||||
RUN mkdir -p uploads local_uploads
|
||||
|
||||
# Copy source with specific paths to avoid unnecessary files
|
||||
COPY src/ ./src/
|
||||
COPY public/ ./public/
|
||||
COPY __tests__/ ./__tests__/
|
||||
COPY dev/ ./dev/
|
||||
COPY .eslintrc.json .eslintignore ./
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
CMD ["npm", "run", "dev"]
|
||||
|
||||
# Production stage
|
||||
FROM deps as production
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Create upload directory
|
||||
RUN mkdir -p uploads
|
||||
|
||||
# Copy only necessary source files
|
||||
COPY src/ ./src/
|
||||
COPY public/ ./public/
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "start"]
|
||||
|
||||
Reference in New Issue
Block a user