mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-11 17:47:35 +00:00
e0725848a9
* chore: fix release workflow to merge docs branch * fix: svg donation generator push fail * fix: svg donation generator push fail * Update termix.rb * fix: svg donation generator push fail * chore: move donation badge to badges branch to avoid ruleset conflicts * chore: remove unneeded token from donation badge workflow * chore: debug donation badge commit step * fix: escape < character in donation SVG * fix: point donation badge to badges branch * chore: remove unused donation badge svg from main * Add Rack Genius logo to README Added Rack Genius logo to the README. * chore: improve donation goal svg generator to include stablecoins * chore: donation goal generator syntax error * chore: donation goal generator incorrect docs url usage * chore(deps): bump node in /docker in the docker-major-updates group Bumps the docker-major-updates group in /docker with 1 update: node. Updates `node` from 24-slim to 26-slim --- updated-dependencies: - dependency-name: node dependency-version: 26-slim dependency-type: direct:production dependency-group: docker-major-updates ... Signed-off-by: dependabot[bot] <support@github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: LukeGus <bugattiguy527@gmail.com> Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
90 lines
2.5 KiB
Docker
90 lines
2.5 KiB
Docker
# Stage 1: Install dependencies
|
|
FROM node:26-slim AS deps
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY package*.json ./
|
|
COPY .npmrc ./
|
|
COPY vendor ./vendor
|
|
|
|
COPY scripts/patch-guacamole-lite.cjs ./scripts/
|
|
|
|
RUN npm ci --ignore-scripts && \
|
|
node scripts/patch-guacamole-lite.cjs && \
|
|
npm cache clean --force
|
|
|
|
# Stage 2: Build frontend
|
|
FROM deps AS frontend-builder
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
RUN find public/fonts -name "*.ttf" ! -name "*Regular.ttf" ! -name "*Bold.ttf" ! -name "*Italic.ttf" -delete
|
|
|
|
RUN npm cache clean --force && \
|
|
NODE_OPTIONS="--max-old-space-size=3072" npm run build
|
|
|
|
# Stage 3: Build backend
|
|
FROM deps AS backend-builder
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
RUN npm rebuild better-sqlite3
|
|
|
|
RUN npm run build:backend
|
|
|
|
# Stage 4: Production dependencies only
|
|
FROM node:26-slim AS production-deps
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY package*.json ./
|
|
COPY .npmrc ./
|
|
COPY vendor ./vendor
|
|
|
|
COPY scripts/patch-guacamole-lite.cjs ./scripts/
|
|
|
|
RUN npm ci --omit=dev --ignore-scripts && \
|
|
node scripts/patch-guacamole-lite.cjs && \
|
|
npm rebuild better-sqlite3 bcryptjs ssh2 && \
|
|
npm cache clean --force
|
|
|
|
# Stage 5: Final optimized image
|
|
FROM node:26-slim
|
|
WORKDIR /app
|
|
|
|
ENV DATA_DIR=/app/data \
|
|
PORT=8080 \
|
|
NODE_ENV=production
|
|
|
|
RUN apt-get update && apt-get install -y nginx gettext-base openssl ca-certificates gosu wget certbot python3-certbot-dns-cloudflare && \
|
|
update-ca-certificates && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
mkdir -p /app/data /app/uploads /app/data/.opk /app/nginx /tmp/nginx && \
|
|
chown -R node:node /app /tmp/nginx && \
|
|
chmod 755 /app/data /app/uploads /app/data/.opk /app/nginx /tmp/nginx
|
|
|
|
COPY docker/nginx.conf /app/nginx/nginx.conf.template
|
|
COPY docker/nginx-https.conf /app/nginx/nginx-https.conf.template
|
|
|
|
COPY --chown=node:node --from=frontend-builder /app/dist /app/html
|
|
|
|
COPY --chown=node:node --from=production-deps /app/node_modules /app/node_modules
|
|
COPY --chown=node:node --from=backend-builder /app/dist/backend ./dist/backend
|
|
COPY --chown=node:node package.json ./
|
|
|
|
VOLUME ["/app/data"]
|
|
|
|
EXPOSE ${PORT} 30001 30002 30003 30004 30005 30006 30007 30008 30009 30010 30011 30012
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
CMD wget -q -O /dev/null http://localhost:30001/health || exit 1
|
|
|
|
COPY docker/entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
CMD ["/entrypoint.sh"]
|