34 lines
712 B
Docker
34 lines
712 B
Docker
# Resource Provider (Node.js + Nginx) Dockerfile
|
|
FROM node:20-alpine
|
|
|
|
# Install nginx
|
|
RUN apk add --no-cache nginx
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install pnpm globally
|
|
RUN npm install -g pnpm
|
|
|
|
# Copy package.json and pnpm-lock.yaml
|
|
COPY package.json pnpm-lock.yaml* ./
|
|
|
|
# Install dependencies
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Copy the rest of the application
|
|
COPY . .
|
|
COPY nginx.conf /etc/nginx/http.d/default.conf
|
|
|
|
# Just fix nginx permissions - let nginx create what it needs
|
|
RUN chown -R nginx:nginx /var/lib/nginx /var/log/nginx
|
|
|
|
# Create static files directory
|
|
RUN mkdir -p /static-files
|
|
|
|
# Expose ports
|
|
EXPOSE 3000 80
|
|
|
|
# Start both nginx and node
|
|
CMD ["sh", "-c", "nginx && node server.js"]
|