added docker

This commit is contained in:
Patrick Alvin Alcala 2025-06-03 12:19:27 +08:00
parent ae1e9306ac
commit 46afefb8d1
2 changed files with 21 additions and 0 deletions

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN corepack enable
RUN pnpm install
COPY . .
RUN pnpm build
FROM nginx:alpine AS runtime
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 8080

9
docker-compose.yml Normal file
View file

@ -0,0 +1,9 @@
services:
portfolio:
container_name: portfolio2
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile
ports:
- ${PORT}:8080