This commit is contained in:
Tomas Mirchev 2025-06-26 03:49:46 +00:00
parent c33d047d4a
commit 71c44269b4
3 changed files with 19 additions and 17 deletions

View File

@ -17,12 +17,24 @@ services:
container_name: resource-provider container_name: resource-provider
ports: ports:
- "3000:3000" # Node.js API - "3000:3000" # Node.js API
- "3005:80" # Nginx static files
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=3000 - PORT=3000
volumes: volumes:
- ./static-files:/static-files - ./static-files:/app/static-files
networks:
- app-network
restart: unless-stopped
static-provider:
build:
context: ./static-provider
dockerfile: Dockerfile
container_name: static-provider
ports:
- "3005:80" # Nginx static files
volumes:
- ./static-files:/usr/share/nginx/html
networks: networks:
- app-network - app-network
restart: unless-stopped restart: unless-stopped

View File

@ -1,9 +1,6 @@
# Resource Provider (Node.js + Nginx) Dockerfile # Resource Provider (Node.js) Dockerfile
FROM node:20-alpine FROM node:20-alpine
# Install nginx
RUN apk add --no-cache nginx
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
@ -18,16 +15,9 @@ RUN pnpm install --frozen-lockfile
# Copy the rest of the application # Copy the rest of the application
COPY . . COPY . .
COPY nginx.conf /etc/nginx/http.d/default.conf
# Just fix nginx permissions - let nginx create what it needs # Expose port
RUN chown -R nginx:nginx /var/lib/nginx /var/log/nginx EXPOSE 3000
# Create static files directory # Start the Node.js application
RUN mkdir -p /static-files CMD ["node", "server.js"]
# Expose ports
EXPOSE 3000 80
# Start both nginx and node
CMD ["sh", "-c", "nginx && node server.js"]