2 Commits

Author SHA1 Message Date
Dome 3a0359c1b6 Update compose.yaml 2025-03-28 13:32:08 +01:00
Dome b560e2dc1e Update Dockerfile 2025-03-28 13:27:33 +01:00
2 changed files with 26 additions and 19 deletions
+16 -14
View File
@@ -1,19 +1,21 @@
# Verwenden Sie ein Node.js-Image als Basis
FROM node:20-alpine
# Setzen Sie das Arbeitsverzeichnis im Container
# Stage 1: Build
FROM node:20-alpine AS build
WORKDIR /app
# Kopieren Sie die package.json und yarn.lock Dateien und installieren Sie die Abhängigkeiten
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Kopieren Sie den Rest des Codes in das Arbeitsverzeichnis
RUN yarn install --frozen-lockfile && yarn cache clean
COPY . .
# Exponieren Sie den Port 5000
EXPOSE 5000
# Stage 2: Production
FROM nginx:alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
# Starten Sie die Anwendung und setzen Sie die PORT-Umgebungsvariable auf 5000
ENV PORT=5000
CMD ["yarn", "start"]
# Expose ports 80 and 443
EXPOSE 80
EXPOSE 443
# Healthcheck
HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1
# Start Nginx server
CMD ["nginx", "-g", "daemon off;"]
+10 -5
View File
@@ -1,11 +1,16 @@
version: '3.8'
services:
matrix-to:
container_name: Matrix-to
web:
image: domoel/matrix-to:latest
ports:
- "5000:5000"
restart: unless-stopped
- "80:80"
environment:
- PORT=5000
- NODE_ENV=production
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3