Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04b "Jack Jackrum". upgrade now! [54.2] (what's this?)
projekte:indico:kingcon_4.0_-_node_im_container

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projekte:indico:kingcon_4.0_-_node_im_container [2023/06/14 15:35] – [neuer Container bei neuem Event / Indico] ecknigkprojekte:indico:kingcon_4.0_-_node_im_container [2024/01/05 13:07] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== KingCon 4.0 - Node im Container  ======
 +
 +**Der "Invoice-Manager".**
 +
 +Eine Nodeanwendung, die eine moderen Bedieneroberfläche fürs KingCon-4.0 bietet.
 +
 +Aktuell ist es so, dass für jedes neue Event/Indico ein neuer Container aufgesetzt wird.
 +===== neuer Container bei neuem Event / Indico =====
 +
 +<note tip>Beispiel-URL: **https://event.eec-2024.com/** \\
 +Beispiel-Port: **15165** (ist so in der Config-Datei des nginx eingetragen) \\ 
 +Beispiel-Projekt: **eec**</note>
 +
 +<code>
 +cd ~/dev/indico/invoice-manager
 +cp -r docker/production docker/production-eec
 +cp .env.sampl .env.eec.production
 +</code>
 +
 +==== env.eec.production ====
 +
 +<code>
 +DATABASE_URL=
 +SHADOW_DATABASE_URL=
 +DEFAULT_LANGUAGE=en
 +NEXT_PUBLIC_BASE_URL=https://event.eec-2024.com/
 +NEXT_PUBLIC_DEFAULT_LANGUAGE=en_GB
 +</code>
 +
 +==== docker/production-eec/docker-compose.yml ====
 +<code>
 +version: '3'
 +
 +services:
 +  eec-production:
 +    build:
 +      context: ../../
 +      dockerfile: docker/production-eec/Dockerfile
 +    image: eec-production
 +    ports:
 +      - '15165:3000'
 +</code>
 +
 +==== docker/production-eec/Dockerfile ====
 +
 +Nur an einer Stelle steht "eec"!
 +
 +<code>
 +# 1. Install dependencies only when needed
 +FROM node:16-alpine AS deps
 +# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
 +RUN apk add --no-cache libc6-compat
 +
 +# HOTFIX: CVE-2022-3996
 +RUN apk upgrade libssl3 libcrypto3
 +
 +WORKDIR /app
 +
 +# Install dependencies based on the preferred package manager
 +COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
 +RUN \
 +  if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
 +  elif [ -f package-lock.json ]; then npm ci; \
 +  elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i; \
 +  else echo "Lockfile not found." && exit 1; \
 +  fi
 +
 +
 +# 2. Rebuild the source code only when needed
 +FROM node:16-alpine AS builder
 +WORKDIR /app
 +COPY --from=deps /app/node_modules ./node_modules
 +COPY . .
 +# This will do the trick, use the corresponding env file for each environment.
 +COPY .env.eec.production .env.production
 +RUN yarn next telemetry disable
 +RUN yarn build
 +
 +# 3. Production image, copy all the files and run next
 +FROM node:16-alpine AS runner
 +WORKDIR /app
 +
 +ENV NODE_ENV=production
 +
 +RUN addgroup -g 1001 -S nodejs
 +RUN adduser -S nextjs -u 1001
 +
 +COPY --from=builder /app/public ./public
 +
 +# Automatically leverage output traces to reduce image size
 +# https://nextjs.org/docs/advanced-features/output-file-tracing
 +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
 +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
 +
 +
 +USER nextjs
 +
 +EXPOSE 3000
 +
 +ENV PORT 3000
 +
 +CMD ["node", "server.js"]
 +</code>
 +
 +==== dann weiter ====
 +
 +Wir sind immer noch in **''~/dev/indico/invoice-manager''**.
 +
 +Das Makefile erweitern
 +
 +<code>
 +.PHONY: build-production-eec
 +build-production-eec: ## Build the production docker image.
 + docker compose -f docker/production-eec/docker-compose.yml build --no-cache
 +</code>
 +
 +Jetzt fiel auf, dass docker auf dem lokalen PC noch fehlte ... Installiert, mit WSL-Einbindung.
 +
 +<code>
 +sudo make build-production-eec
 +sudo docker save eec-production > eec-production-230613.tar
 +scp eec-production-230613.tar root@193.254.190.30:/opt/eec/container
 +</code>
 +
 +Das **''scp''** funktioniert, da auf dem Indico-Server schon das "klassische" Indico für **eec** eingerichtet ist und es die Ordner gibt.
 +
 +==== auf dem Indico-Server ====
 +
 +... geht es dann [[https://brain.tema-hosting.de/projekte/kingcon_register-me.org/kingcon_4.0_-_neues_event_aufsetzen#start_services_and_create_default_user|so weiter]].
 +===== Zusatzinformationen =====
 +
 +===== Unterprojekte =====
 +
 +{{indexmenu>projekte:indico:kingcon_4.0_-_node_im_container#2| js doku}}
 +\\
 +Neues Projekt anlegen:  {{NEWPAGE>projekte:indico:kingcon_4.0_-_node_im_container}}
 +
 +
 +
 +===== Kommentare =====
 +
 +
 +