diff --git a/.github/workflows/docker-preview.yml b/.github/workflows/docker-preview.yml index f90317a..0a95cf8 100644 --- a/.github/workflows/docker-preview.yml +++ b/.github/workflows/docker-preview.yml @@ -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: diff --git a/Dockerfile b/Dockerfile index 51033a1..430af33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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"] \ No newline at end of file diff --git a/buildall.sh b/buildall.sh deleted file mode 100755 index d2fd5a4..0000000 --- a/buildall.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Create a new builder instance -docker buildx create --name mybuilder --use - -# Build and push the amd64 image -docker buildx build --platform linux/amd64 -t ipmake/perplexed:latest-amd64 . --push - -# Build and push the arm64 image -docker buildx build --platform linux/arm64 -t ipmake/perplexed:latest-arm64 . --push - -# Create and push the manifest -docker buildx imagetools create --tag ipmake/perplexed:latest ipmake/perplexed:latest-amd64 ipmake/perplexed:latest-arm64 -# docker buildx imagetools push ipmake/perplexed:latest \ No newline at end of file