Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 05ebb904b2 | |||
| 73200e8c27 | |||
| 27ff8f19c7 | |||
| 8124698775 | |||
| 58890a7c9d | |||
| 521b2adf67 | |||
| 84db9ecc9e | |||
| b75ca64d22 | |||
| 8fee384fc0 | |||
| 8c2db8fdc5 | |||
| bda105ceeb | |||
| 4e4e034db2 | |||
| b8047a7988 | |||
| ef85f6782d | |||
| 46a14f0e46 | |||
| ed1230eee8 | |||
| 334393b9de | |||
| 684f3f70dd | |||
| 70b5a4979d | |||
| 1898808f79 | |||
| df2c426d76 | |||
| f04e9484e7 | |||
| 3fa1ad7269 | |||
| 66cc550949 | |||
| 3a0359c1b6 | |||
| b560e2dc1e |
+18
-14
@@ -1,19 +1,23 @@
|
|||||||
# Verwenden Sie ein Node.js-Image als Basis
|
# Stage 1: Build
|
||||||
FROM node:20-alpine
|
FROM node:20.2-alpine AS build
|
||||||
|
|
||||||
# Setzen Sie das Arbeitsverzeichnis im Container
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Kopieren Sie die package.json und yarn.lock Dateien und installieren Sie die Abhängigkeiten
|
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn install --frozen-lockfile
|
RUN yarn install
|
||||||
|
|
||||||
# Kopieren Sie den Rest des Codes in das Arbeitsverzeichnis
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
# Exponieren Sie den Port 5000
|
# Stage 2: Production
|
||||||
EXPOSE 5000
|
FROM nginx:alpine
|
||||||
|
WORKDIR /etc/nginx
|
||||||
|
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||||
|
WORKDIR /usr/share/nginx/html
|
||||||
|
COPY --from=build /app/build .
|
||||||
|
|
||||||
# Starten Sie die Anwendung und setzen Sie die PORT-Umgebungsvariable auf 5000
|
# Expose port 80
|
||||||
ENV PORT=5000
|
EXPOSE 80
|
||||||
CMD ["yarn", "start"]
|
|
||||||
|
# Healthcheck
|
||||||
|
HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1
|
||||||
|
|
||||||
|
# Start Nginx server
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
@@ -93,12 +93,17 @@ You can discuss matrix.to in
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
matrix-to:
|
web:
|
||||||
container_name: Matrix-to
|
|
||||||
image: domoel/matrix-to:latest
|
image: domoel/matrix-to:latest
|
||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "1336:80"
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
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
|
||||||
```
|
```
|
||||||
|
|||||||
+10
-5
@@ -1,11 +1,16 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
matrix-to:
|
web:
|
||||||
container_name: Matrix-to
|
|
||||||
image: domoel/matrix-to:latest
|
image: domoel/matrix-to:latest
|
||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "1336:80"
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
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
|
||||||
|
|||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 404 /404.html;
|
||||||
|
location = /404.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user