Skip to content

Commit

Permalink
cd fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eun-hak committed Jul 1, 2024
1 parent 4e5f5be commit f2609aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ RUN yarn install
COPY . .
RUN yarn build

# Step 2: Serve the Vite app using a simple HTTP server
# Step 2: Serve the Vite app using PM2
FROM node:20-alpine

WORKDIR /app

COPY --from=builder /app/dist /app

RUN npm install -g serve
RUN npm install -g pm2

COPY ecosystem.config.js ./

EXPOSE 3000

CMD ["serve", "-s", ".", "-l", "3000"]
CMD ["pm2-runtime", "ecosystem.config.js"]
12 changes: 12 additions & 0 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
apps: [
{
name: 'vite-react-app',
script: 'serve',
args: '-s . -l 3000',
env: {
NODE_ENV: 'production',
},
},
],
};

0 comments on commit f2609aa

Please sign in to comment.