Improve security

This commit is contained in:
2025-08-23 22:36:31 +03:00
Unverified
parent 1fa1178397
commit c1a4a78658
2 changed files with 21 additions and 5 deletions
+11 -3
View File
@@ -5,8 +5,6 @@ services:
context: ..
environment:
PORT: 8300
ports:
- "8300:8300"
volumes:
- "data:/app/data"
develop:
@@ -16,6 +14,8 @@ services:
target: /app
- action: rebuild
path: ../backend/requirements.txt
networks:
- main
frontend:
build:
@@ -37,7 +37,15 @@ services:
target: /server/server.js
- action: rebuild
path: package.json
networks:
- main
- default
volumes:
data:
name: fromchat-data
name: fromchat-data
networks:
main:
driver: bridge
internal: true # isolate from the outside world
+10 -2
View File
@@ -26,13 +26,21 @@ COPY deployment/frontend/ .
# 3. Put it all together
FROM node:24-slim
# 3.1. Non-root user
RUN useradd -u 1001 app && \
mkdir -p /app && \
chown -R app /app && \
mkdir /server && \
chown -R app /server
USER app
# 3.1. Frontend static files
WORKDIR /app
COPY --from=frontend /app/frontend/dist .
COPY --from=frontend --chown=app /app/frontend/dist .
# 3.2. Static file server
WORKDIR /server
COPY --from=server /server .
COPY --from=server --chown=app /server .
# 4. Final command
ENV STATIC_FILE_PATH=/app