test / server /Dockerfile
akborana4's picture
Create Dockerfile
8a830b8 verified
# Base Node image
FROM node:18-alpine
# Install nginx for static frontend
RUN apk add --no-cache nginx
# Create directories
WORKDIR /app
COPY server ./server
COPY app ./app
# Install backend dependencies
WORKDIR /app/server
RUN npm install
# Expose Ports
EXPOSE 8080 80
# Start both backend and frontend
CMD sh -c "node /app/server/server.js & nginx -g 'daemon off;'"