Skip to content

Commit

Permalink
feat: Streamline frontend build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Ipmake committed Jan 15, 2025
1 parent 0a203bd commit fac7816
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 29 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/docker-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install dependencies
run: npm install
working-directory: frontend

- name: Build frontend
run: npm run build
working-directory: frontend

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
Expand Down
19 changes: 2 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
FROM node:20-bookworm-slim as frontend_builder

WORKDIR /app

COPY frontend/package*.json ./

# Install the app dependencies
RUN npm install

COPY frontend .

RUN npm run build

# /// Runner ///

FROM node:20-bookworm-slim as runner
FROM node:22-bookworm-slim as runner

WORKDIR /app

Expand All @@ -24,6 +9,6 @@ RUN npx tsc

EXPOSE 3000

COPY --from=frontend_builder /app/build/ /app/www/
COPY frontend/build/ /app/www/

CMD ["node", "dist/index.js"]
12 changes: 0 additions & 12 deletions buildall.sh

This file was deleted.

0 comments on commit fac7816

Please sign in to comment.