From 6f3edc897734bb89f8180823fc1711302d396ef7 Mon Sep 17 00:00:00 2001 From: Kenzo Date: Wed, 23 Jul 2025 21:32:24 +0200 Subject: [PATCH] Update deployment configuration files for optimized CI/CD pipeline - Simplified `fly.toml` by removing inline comments. - Refactored `.woodpecker.yml` pipeline syntax for better clarity and flexibility. - Adjusted `Dockerfile` to fix `dist` directory path and streamline `CMD` execution. --- .woodpecker.yml | 44 +++++++++++++++++++++++++++----------------- Dockerfile | 13 ++++--------- fly.toml | 2 +- 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 23aa22a..02741f9 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,27 +1,37 @@ -pipeline: - build: +steps: + - name: build image: node:20-alpine + pull: true commands: - npm ci - npm run build when: - branch: main - event: [push, pull_request] - deploy: - depends_on: [build] - image: flyio/flyctl:latest - secrets: [fly_api_token] - commands: - - flyctl deploy --remote-only - when: - branch: main - event: push + branch: + include: + - main + event: + include: + - push + - pull_request -branches: - include: [main, dev] + - name: deploy + image: flyio/flyctl:latest + pull: true + depends_on: + - build + secrets: + - fly_api_token + commands: + - flyctl deploy --remote-only --config ./fly.toml + when: + branch: + include: + - main + event: + include: + - push cache: mount: - node_modules - - .npm - - dist \ No newline at end of file + - dist diff --git a/Dockerfile b/Dockerfile index e521d68..cc52040 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,20 @@ FROM node:20-alpine AS build WORKDIR /app - COPY package*.json ./ RUN npm ci - COPY . . - RUN npm run build FROM node:20-alpine AS production WORKDIR /app - RUN npm install -g serve - -COPY --from=build /app/dist /app +COPY --from=build /app/dist ./dist EXPOSE 3000 - -CMD ["serve", "-s", ".", "-l", "3000"] +CMD ["serve", "-s", "dist", "-l", "3000"] HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget -qO- http://localhost:3000/ || exit 1 \ No newline at end of file + CMD wget -qO- http://localhost:3000/ || exit 1 +calhost:3000/ || exit 1 \ No newline at end of file diff --git a/fly.toml b/fly.toml index 74135d1..6bb56b8 100644 --- a/fly.toml +++ b/fly.toml @@ -1,5 +1,5 @@ app = "gallus-pub" -primary_region = "fra" # Frankfurt region, change if needed +primary_region = "fra" kill_signal = "SIGINT" kill_timeout = 5