Merge pull request #17 from chinnsenn/main

support docker/docker compose
This commit is contained in:
Mr. Algorithm 2025-10-08 16:30:48 +05:30 committed by GitHub
commit 14c867b05d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 0 deletions

31
Dockerfile Normal file
View File

@ -0,0 +1,31 @@
# Use official Node.js 20 Alpine image as base
FROM node:20-alpine
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json to leverage Docker cache
COPY package*.json ./
# Uncomment the next line if you use pnpm and have pnpm-lock.yaml
# COPY pnpm-lock.yaml ./
# Install dependencies (choose npm or pnpm)
RUN npm install
# If using pnpm, replace with:
# RUN npm install -g pnpm && pnpm install
# Copy all project files
COPY . .
# Build the Next.js application
RUN npm run build
# Or if using pnpm:
# RUN pnpm run build
# Expose the port Next.js runs on
EXPOSE 3000
# Start the Next.js production server
CMD ["npm", "start"]
# Or if using pnpm:
# CMD ["pnpm", "start"]

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
services:
openstock:
build: .
ports:
- "3000:3000"
env_file:
- .env
restart: unless-stopped