add docker file

This commit is contained in:
StarAppeal
2025-09-24 06:21:48 +02:00
parent 2796c465c0
commit 4e867d229c
4 changed files with 58 additions and 21 deletions
+3 -1
View File
@@ -132,4 +132,6 @@ dist
.pnp.*
tests//*.js/*.js.map
tests//*.js/*.js.map
minio-data
+24
View File
@@ -0,0 +1,24 @@
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY --from=builder /app/dist ./dist
EXPOSE 3000
CMD [ "node", "dist/index.js" ]
+31
View File
@@ -0,0 +1,31 @@
version: '3.8'
services:
backend:
container_name: ledmatrix-backend
build: .
restart: always
env_file:
- .env
ports:
- "3000:3000"
depends_on:
- minio
networks:
- app-network
minio:
image: minio/minio:latest
container_name: ledmatrix-storage
restart: always
env_file:
- .env
volumes:
- ./minio-data:/data
command: server /data --console-address ":9001"
networks:
- app-network
networks:
app-network:
driver: bridge
-20
View File
@@ -1,20 +0,0 @@
module.exports = {
apps: [
{
name: 'matrix-backend',
script: 'dist/src/index.js',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env_production: {
NODE_ENV: 'production',
},
env_staging: {
NODE_ENV: 'staging',
PORT: 3000
}
},
],
};