diff --git a/.prettierrc b/.prettierrc index b203bcc81..d142afd0f 100644 --- a/.prettierrc +++ b/.prettierrc @@ -7,7 +7,7 @@ } }, { - "files": "Dockerfile", + "files": "*.Dockerfile", "options": { "plugins": [] } diff --git a/Dockerfile b/Dockerfile index dc8230990..c46187932 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,5 @@ -# Use an official Node runtime as the base image -FROM node:24-slim AS base -# Set the working directory in the container -WORKDIR /usr/src/app +FROM evanpelle/openfront-base:latest AS base -# Create dependency layer -FROM base AS dependencies -RUN apt-get update && apt-get install -y \ - nginx \ - git \ - curl \ - jq \ - wget \ - apache2-utils \ - && rm -rf /var/lib/apt/lists/* - -# Update worker_connections in the existing nginx.conf -RUN sed -i 's/worker_connections [0-9]*/worker_connections 8192/' /etc/nginx/nginx.conf - -FROM dependencies AS build ARG GIT_COMMIT=unknown ENV GIT_COMMIT="$GIT_COMMIT" # Disable Husky hooks @@ -39,7 +21,7 @@ FROM base AS prod-files COPY . . RUN rm -rf resources/maps -FROM dependencies AS npm-dependencies +FROM base AS npm-dependencies # Disable Husky hooks ENV HUSKY=0 ENV NPM_CONFIG_IGNORE_SCRIPTS=1 @@ -52,21 +34,11 @@ RUN npm ci --omit=dev FROM base ARG GIT_COMMIT=unknown ENV GIT_COMMIT="$GIT_COMMIT" -RUN apt-get update && apt-get install -y \ - nginx \ - supervisor \ - curl \ - && rm -rf /var/lib/apt/lists/* - -# Copy installed packages from dependencies stage -RUN curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb > cloudflared.deb \ - && dpkg -i cloudflared.deb \ - && rm cloudflared.deb # Copy Nginx configuration and ensure it's used instead of the default COPY nginx.conf /etc/nginx/conf.d/default.conf RUN rm -f /etc/nginx/sites-enabled/default -COPY --from=dependencies /etc/nginx/nginx.conf /etc/nginx/nginx.conf +COPY --from=base /etc/nginx/nginx.conf /etc/nginx/nginx.conf # Copy npm dependencies COPY --from=npm-dependencies /usr/src/app/node_modules node_modules @@ -76,7 +48,7 @@ COPY package.json . COPY --from=prod-files /usr/src/app/ /usr/src/app/ # Copy frontend -COPY --from=build /usr/src/app/static static +COPY --from=base /usr/src/app/static static # Setup supervisor configuration RUN mkdir -p /var/log/supervisor @@ -86,9 +58,9 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY startup.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/startup.sh -RUN mkdir -p /etc/cloudflared && \ - chown -R node:node /etc/cloudflared && \ - chmod -R 755 /etc/cloudflared +RUN mkdir -p /etc/cloudflared \ + && chown -R node:node /etc/cloudflared \ + && chmod -R 755 /etc/cloudflared # Set Cloudflared config directory to a volume mount location ENV CF_CONFIG_PATH=/etc/cloudflared/config.yml diff --git a/README.md b/README.md index c6aafda82..1f606c1c3 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,6 @@ Feel free to ask questions in the translation Discord server! To ensure code quality and project stability, we use a progressive contribution system: 1. **New Contributors**: Limited to UI improvements and small bug fixes only - - This helps you become familiar with the codebase - UI changes are easier to review and less likely to break core functionality - Small, focused PRs have a higher chance of being accepted @@ -193,20 +192,17 @@ To ensure code quality and project stability, we use a progressive contribution ### How to Contribute Successfully 1. **Before Starting Work**: - - Open an issue describing what you want to contribute - Wait for maintainer feedback before investing significant time - Small improvements can proceed directly to PR stage 2. **Code Quality Requirements**: - - All code must be well-commented and follow existing style patterns - New features should not break existing functionality - Code should be thoroughly tested before submission - All code changes in src/core _MUST_ be tested. 3. **Pull Request Process**: - - Keep PRs focused on a single feature or bug fix - Include screenshots for UI changes - Describe what testing you've performed diff --git a/base.Dockerfile b/base.Dockerfile new file mode 100644 index 000000000..dff6da892 --- /dev/null +++ b/base.Dockerfile @@ -0,0 +1,24 @@ +FROM node:24-slim + +RUN apt-get update && apt-get install -y \ + nginx \ + supervisor \ + git \ + curl \ + jq \ + wget \ + apache2-utils \ + && rm -rf /var/lib/apt/lists/* + +RUN curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb > cloudflared.deb \ + && dpkg -i cloudflared.deb \ + && rm cloudflared.deb + +RUN sed -i 's/worker_connections [0-9]*/worker_connections 8192/' /etc/nginx/nginx.conf + +RUN mkdir -p /var/log/supervisor /etc/cloudflared && \ + chown -R node:node /etc/cloudflared && \ + chmod -R 755 /etc/cloudflared + + +WORKDIR /usr/src/app \ No newline at end of file diff --git a/src/client/index.html b/src/client/index.html index 112485910..99a9c39c1 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -481,7 +481,9 @@ >