From 78b51a725755a8f5d033eac3e9e3f38be0c18bb1 Mon Sep 17 00:00:00 2001 From: H4CK3R-01 Date: Mon, 13 Mar 2023 15:25:15 +0100 Subject: [PATCH] Trying to fix pipeline --- .woodpecker.yml | 22 +++++++++++----------- backend/Dockerfile => Dockerfile.Backend | 4 ++-- Dockerfile.Frontend | 7 +++++++ frontend/Dockerfile | 7 ------- 4 files changed, 20 insertions(+), 20 deletions(-) rename backend/Dockerfile => Dockerfile.Backend (77%) create mode 100644 Dockerfile.Frontend delete mode 100644 frontend/Dockerfile diff --git a/.woodpecker.yml b/.woodpecker.yml index c09993f..890e690 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -3,9 +3,9 @@ pipeline: image: golang commands: - echo -n "${CI_COMMIT_BRANCH//\//-}-${CI_COMMIT_SHA:0:8}, latest" > .tags - when: - path: [ "frontend/**", "backend/**" ] - event: push + #when: + # path: [ "frontend/**", "backend/**" ] + # event: push # -------------------------------------- Backend -------------------------------------- @@ -20,11 +20,11 @@ pipeline: from_secret: registry_password registry: from_secret: registry - dockerfile: backend/Dockerfile + dockerfile: Dockerfile.Backend platforms: linux/amd64 - when: - path: "backend/**" - event: push + #when: + # path: "backend/**" + # event: push # -------------------------------------- Frontend -------------------------------------- @@ -39,10 +39,10 @@ pipeline: from_secret: registry_password registry: from_secret: registry - dockerfile: frontend/Dockerfile + dockerfile: Dockerfile.Frontend platforms: linux/amd64 - when: - path: "frontend/**" - event: push + #when: + # path: "frontend/**" + # event: push branches: main diff --git a/backend/Dockerfile b/Dockerfile.Backend similarity index 77% rename from backend/Dockerfile rename to Dockerfile.Backend index c21de60..d4ebd18 100644 --- a/backend/Dockerfile +++ b/Dockerfile.Backend @@ -1,13 +1,13 @@ FROM python:3.8 WORKDIR /app -ADD requirements.txt /app/requirements.txt +ADD ./backend/requirements.txt /app/requirements.txt RUN pip install --upgrade -r requirements.txt EXPOSE 8080 -COPY ./ /app +COPY ./backend/ /app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"] diff --git a/Dockerfile.Frontend b/Dockerfile.Frontend new file mode 100644 index 0000000..841c584 --- /dev/null +++ b/Dockerfile.Frontend @@ -0,0 +1,7 @@ +FROM nginx:latest + +COPY ./frontend/index.html /usr/share/nginx/html/index.html +COPY ./frontend/index.css /usr/share/nginx/html/index.css +COPY ./frontend/index.js /usr/share/nginx/html/index.js + +HEALTHCHECK --interval=1m --timeout=3s CMD curl --fail http://localhost/ || exit 1 \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile deleted file mode 100644 index df5cb54..0000000 --- a/frontend/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM nginx:latest - -COPY ./index.html /usr/share/nginx/html/index.html -COPY ./index.css /usr/share/nginx/html/index.css -COPY ./index.js /usr/share/nginx/html/index.js - -HEALTHCHECK --interval=1m --timeout=3s CMD curl --fail http://localhost/ || exit 1 \ No newline at end of file