Skip to content

Commit

Permalink
xig: deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhJae committed Sep 3, 2024
1 parent 847ce46 commit caf3ec5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Deploy to server
run: |
ssh ${{ secrets.USER }}@${{ secrets.SERVER_IP }} << 'ENDSSH'
ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} << 'ENDSSH'
cd ${{ secrets.SERVER_DEPLOY_PATH }}
git pull origin main
docker stop ${{ secrets.APP_NAME }} || true
Expand Down
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG NODE_VERSION=22.5.1

FROM node:${NODE_VERSION}-slim as base

ARG PORT=3000

ENV NODE_ENV=production

WORKDIR /src

# Build
FROM base as build

COPY --link package.json package-lock.json ./
RUN npm install --production=false

COPY --link . .

RUN npm run build
RUN npm prune

# Run
FROM base

ENV PORT=$PORT

COPY --from=build /src/.output /src/.output
# Optional, only needed if you rely on unbundled dependencies
# COPY --from=build /src/node_modules /src/node_modules

CMD [ "node", ".output/server/index.mjs" ]

0 comments on commit caf3ec5

Please sign in to comment.