-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Modify Dockerfile.nginx to use monorepo build system
- Loading branch information
유미라
authored and
유미라
committed
Nov 27, 2024
1 parent
f3eb8e4
commit 941837e
Showing
2 changed files
with
12 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,32 +50,6 @@ jobs: | |
needs: ci | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: '9' | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Build Core Package | ||
working-directory: ./core | ||
run: pnpm build | ||
|
||
- name: Build Client | ||
working-directory: ./client | ||
env: | ||
VITE_API_URL: ${{secrets.VITE_API_URL}} | ||
VITE_SOCKET_URL: ${{secrets.VITE_SOCKET_URL}} | ||
run: pnpm build | ||
|
||
- name: Deploy to Server | ||
uses: appleboy/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
FROM nginx:alpine | ||
FROM node:20-alpine AS builder | ||
|
||
RUN corepack enable && corepack prepare [email protected] --activate | ||
|
||
WORKDIR /app | ||
|
||
RUN mkdir -p /usr/share/nginx/html /etc/nginx/templates | ||
COPY . . | ||
|
||
COPY nginx.conf /etc/nginx/templates/default.conf.template | ||
RUN pnpm install --frozen-lockfile && pnpm build | ||
|
||
FROM nginx:alpine | ||
|
||
COPY client/dist /usr/share/nginx/html | ||
COPY nginx.conf /etc/nginx/templates/default.conf.template | ||
COPY --from=builder /app/client/dist /usr/share/nginx/html | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["/bin/sh", "-c", "envsubst '${SERVER_IP}' < /etc/nginx/templates/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"] | ||
CMD ["nginx", "-g", "daemon off;"] |