add docker files

This commit is contained in:
2025-07-07 02:06:26 +05:30
parent 5f25b81b35
commit cf0643c207
5 changed files with 61 additions and 0 deletions

6
backend/.dockerignore Normal file
View File

@ -0,0 +1,6 @@
node_modules
uploads
.git
.dockerignore
Dockerfile
.env

20
backend/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# Use the official Node.js 23.10 image
FROM node:23.10
# Set working directory inside the container
WORKDIR /app
# Copy only package.json and lock file first for caching
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the app (after installing dependencies for cache efficiency)
COPY . .
# Expose the port your server listens on (adjust if needed)
EXPOSE 8005
# Start the app
CMD ["node", "server.js"]

14
docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: '3.8'
services:
frontend:
build: ./frontend/resume-builder
ports:
- "4173:3000"
restart: always
backend:
build: ./backend
ports:
- "8005:8005"
restart: always

View File

@ -0,0 +1,5 @@
node_modules
.git
.dockerignore
Dockerfile
.env

View File

@ -0,0 +1,16 @@
# Use Node 23.10
FROM node:23.10
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
# Serve using static server
RUN npm install -g serve
EXPOSE 3000
CMD ["serve", "-s", "dist", "-l", "3000"]