From 053900757443cf42571f56f52c4308a4e022c8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melaine=20G=C3=A9rard?= Date: Fri, 1 Nov 2024 15:11:45 +0100 Subject: [PATCH] :sparkles: Ajout docker --- .gitea/workflows/build-docker.yml | 28 ++++++++++++++++++++++++++++ Dockerfile | 15 +++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .gitea/workflows/build-docker.yml create mode 100644 Dockerfile diff --git a/.gitea/workflows/build-docker.yml b/.gitea/workflows/build-docker.yml new file mode 100644 index 0000000..0c64512 --- /dev/null +++ b/.gitea/workflows/build-docker.yml @@ -0,0 +1,28 @@ +name: Build and Push Docker Image + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: alpine:latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build and Push with Kaniko + uses: aevea/action-kaniko@master + with: + image: git.crystalyx.net/${{ gitea.repository }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + registry: git.crystalyx.net + tag: ${{ github.ref_name }},latest + cache: true + cache_registry: git.crystalyx.net/${{ gitea.repository }}/cache + extra_args: | + --snapshot-mode=redo + --use-new-run + --compressed-caching=false \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f0aab17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:20 + +# Create app directory +WORKDIR /app + +# Install app dependencies +COPY package.json /app +COPY package-lock.json /app + +RUN npm install + +# Bundle app source +COPY . /app + +CMD [ "npm", "run", "start:clean" ]