From 3b7297c2fe93b9495fa3ed5aea87bc2e5f187079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Fri, 16 Feb 2024 15:55:12 +0100 Subject: [PATCH 01/11] start of gitlab-ci --- .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..96c2da0 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +stages: + - linting + - testing + - build + - staging + - production + +default: + image: python:3.12-slim + before_script: + - ... +pre-commit: + stage: linting -- 2.45.2 From 1902147f820c6cc3d6479fdb5290acad0581d914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Sat, 17 Aug 2024 21:28:13 +0200 Subject: [PATCH 02/11] application dockerized --- .dockerignore | 4 ++ Dockerfile | 48 ++++++++++++++++++++ poetry.lock | 88 ++++++++++++++++++++++++++++++++++++- pyproject.toml | 3 ++ scripts/entrypoint.sh | 5 +++ scripts/run.sh | 7 +++ {utils => scripts}/start.sh | 0 7 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 scripts/entrypoint.sh create mode 100644 scripts/run.sh rename {utils => scripts}/start.sh (100%) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9eb9db7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git/ +.idea/ +*.drawio +.ruff_cache/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ac608cd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,48 @@ +ARG PYTHON_VERSION=3.12 + +FROM python:${PYTHON_VERSION}-alpine AS base + +ENV PYTHONUNBUFFERED=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=on \ + DEBIAN_FRONTEND=noninteractive \ + POETRY_VIRTUALENVS_CREATE=false \ + VENV=/root/.venv + + +RUN adduser --disabled-password --gecos "" django + +FROM base as poetry + +ARG POETRY_VERSION=1.8.3 + +RUN : \ + && python -m venv ${VENV} \ + && . ${VENV}/bin/activate \ + && pip install poetry==${POETRY_VERSION} \ + && : + +ENV PATH="${VENV}/bin:${PATH}" + +FROM poetry as deps + +WORKDIR /app + +COPY pyproject.toml poetry.lock ./ + +RUN poetry install --no-interaction --no-ansi -vvv + +COPY scripts/ /usr/local/tmp-bin + +RUN chmod +x /usr/local/tmp-bin/* \ + && mv /usr/local/tmp-bin/* /usr/local/bin \ + && rmdir /usr/local/tmp-bin + +ENTRYPOINT ["entrypoint.sh"] + +FROM deps as production + +WORKDIR /app + +COPY --chown=django . . + +CMD ["run.sh"] diff --git a/poetry.lock b/poetry.lock index 7cf0189..025fd0e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -138,6 +138,31 @@ files = [ {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, ] +[[package]] +name = "click" +version = "8.1.7" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +files = [ + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + [[package]] name = "crispy-bootstrap5" version = "2023.10" @@ -206,6 +231,38 @@ develop = ["coverage[toml] (>=5.0a4)", "furo (>=2021.8.17b43,<2021.9.dev0)", "py docs = ["furo (>=2021.8.17b43,<2021.9.dev0)", "sphinx (>=3.5.0)", "sphinx-notfound-page"] testing = ["coverage[toml] (>=5.0a4)", "pytest (>=4.6.11)"] +[[package]] +name = "gunicorn" +version = "23.0.0" +description = "WSGI HTTP Server for UNIX" +optional = false +python-versions = ">=3.7" +files = [ + {file = "gunicorn-23.0.0-py3-none-any.whl", hash = "sha256:ec400d38950de4dfd418cff8328b2c8faed0edb0d517d3394e457c317908ca4d"}, + {file = "gunicorn-23.0.0.tar.gz", hash = "sha256:f014447a0101dc57e294f6c18ca6b40227a4c90e9bdb586042628030cba004ec"}, +] + +[package.dependencies] +packaging = "*" + +[package.extras] +eventlet = ["eventlet (>=0.24.1,!=0.36.0)"] +gevent = ["gevent (>=1.4.0)"] +setproctitle = ["setproctitle"] +testing = ["coverage", "eventlet", "gevent", "pytest", "pytest-cov"] +tornado = ["tornado (>=0.2)"] + +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + [[package]] name = "idna" version = "3.7" @@ -217,6 +274,17 @@ files = [ {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, ] +[[package]] +name = "packaging" +version = "24.1" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, +] + [[package]] name = "requests" version = "2.32.3" @@ -281,7 +349,25 @@ h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] +[[package]] +name = "uvicorn" +version = "0.30.6" +description = "The lightning-fast ASGI server." +optional = false +python-versions = ">=3.8" +files = [ + {file = "uvicorn-0.30.6-py3-none-any.whl", hash = "sha256:65fd46fe3fda5bdc1b03b94eb634923ff18cd35b2f084813ea79d1f103f711b5"}, + {file = "uvicorn-0.30.6.tar.gz", hash = "sha256:4b15decdda1e72be08209e860a1e10e92439ad5b97cf44cc945fcbee66fc5788"}, +] + +[package.dependencies] +click = ">=7.0" +h11 = ">=0.8" + +[package.extras] +standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "watchfiles (>=0.13)", "websockets (>=10.4)"] + [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "fc91f96209fbdf439cf9da459e6b98e3897b9672d0250bc97a7622a190006ff4" +content-hash = "b23715e240b100e65d717f81ec69f1f9fa5ef542cdba6e3c97841789625bc13b" diff --git a/pyproject.toml b/pyproject.toml index 1d7040f..79521b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,7 @@ description = "" authors = ["Jakub Kropáček "] license = "MIT" readme = "README.md" +package-mode = false [tool.poetry.dependencies] python = "^3.12" @@ -13,6 +14,8 @@ crispy-bootstrap5 = "^2023.10" django-crispy-forms = "^2.1" ares-util = "^0.3.0" django-environ = "^0.11.2" +gunicorn = "^23.0.0" +uvicorn = "^0.30.6" [build-system] diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh new file mode 100644 index 0000000..d30078a --- /dev/null +++ b/scripts/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +#wait-for-it --service db:5432 -- echo "database is running" + +exec "$@" diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100644 index 0000000..85477fa --- /dev/null +++ b/scripts/run.sh @@ -0,0 +1,7 @@ +#/bin/sh + +gunicorn \ + --threads 2 \ + --workers 4 \ + --worker-class uvicorn.workers.UvicornWorker \ + facturio.asgi diff --git a/utils/start.sh b/scripts/start.sh similarity index 100% rename from utils/start.sh rename to scripts/start.sh -- 2.45.2 From 9ef53494096cedcc6f37e197f922bcbab245e643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Sat, 17 Aug 2024 21:29:19 +0200 Subject: [PATCH 03/11] base build? --- .gitlab-ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 96c2da0..4900c7d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,11 @@ stages: default: image: python:3.12-slim - before_script: - - ... -pre-commit: - stage: linting + +#pre-commit: +# stage: linting + +build_image: + stage: build + script: + - docker build -t facturio . -- 2.45.2 From d33028409f783adae90d023855ed1c75f12dc35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Sat, 17 Aug 2024 21:31:11 +0200 Subject: [PATCH 04/11] i need docker here --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4900c7d..1b975f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,5 +13,8 @@ default: build_image: stage: build + image: docker + services: + - docker script: - docker build -t facturio . -- 2.45.2 From e5d383f068603b02b7eba563f348e61c019ba222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Sat, 17 Aug 2024 21:33:03 +0200 Subject: [PATCH 05/11] fix casing --- .gitlab-ci.yml | 3 --- Dockerfile | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b975f6..4d164a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,9 +8,6 @@ stages: default: image: python:3.12-slim -#pre-commit: -# stage: linting - build_image: stage: build image: docker diff --git a/Dockerfile b/Dockerfile index ac608cd..f265651 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ENV PYTHONUNBUFFERED=1 \ RUN adduser --disabled-password --gecos "" django -FROM base as poetry +FROM base AS poetry ARG POETRY_VERSION=1.8.3 @@ -23,7 +23,7 @@ RUN : \ ENV PATH="${VENV}/bin:${PATH}" -FROM poetry as deps +FROM poetry AS deps WORKDIR /app @@ -39,7 +39,7 @@ RUN chmod +x /usr/local/tmp-bin/* \ ENTRYPOINT ["entrypoint.sh"] -FROM deps as production +FROM deps AS production WORKDIR /app -- 2.45.2 From c64c5788183fb6361bf7278a370f5b0efd808dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Sat, 17 Aug 2024 21:38:32 +0200 Subject: [PATCH 06/11] added tagging and pushing? --- .gitlab-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d164a8..e0b9baf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,4 +14,10 @@ build_image: services: - docker script: - - docker build -t facturio . + - docker build -t ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} . + - docker push ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} + - | + if [[ -z "${CI_COMMIT_TAG}" ]]; then + docker tag ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_TAG} + docker push ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_TAG} + fi -- 2.45.2 From fede8d0320794c13d9c3d0bc11e8d1f1dea8bf60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Sat, 17 Aug 2024 21:40:27 +0200 Subject: [PATCH 07/11] auth fix? --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0b9baf..487a885 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,8 @@ stages: default: image: python:3.12-slim + before_script: + - docker login ${CI_REGISTRY} -u gitlab-ci-token -p ${CI_JOB_TOKEN} build_image: stage: build -- 2.45.2 From 9d216697889b9e946e9de29deeac028f4c826887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Sat, 17 Aug 2024 21:44:04 +0200 Subject: [PATCH 08/11] reorganized --- .gitlab-ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 487a885..e5def2a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,11 +15,13 @@ build_image: image: docker services: - docker + variables: + CONTAINER_NAME: ${CI_REGISTRY_IMAGE}/facturio script: - - docker build -t ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} . - - docker push ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} + - docker build -t ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} . + - docker push ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} - | - if [[ -z "${CI_COMMIT_TAG}" ]]; then - docker tag ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_TAG} - docker push ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_TAG} + if [[ -n "${CI_COMMIT_TAG}" ]]; then + docker tag ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} ${CONTAINER_NAME}:${CI_COMMIT_TAG} + docker push ${CONTAINER_NAME}:${CI_COMMIT_TAG} fi -- 2.45.2 From 2b306764316a3464546e6f7dc7afafd6c09d79d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Sat, 17 Aug 2024 21:46:36 +0200 Subject: [PATCH 09/11] pre-commit run? --- .gitlab-ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5def2a..f416545 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,9 +6,14 @@ stages: - production default: - image: python:3.12-slim - before_script: - - docker login ${CI_REGISTRY} -u gitlab-ci-token -p ${CI_JOB_TOKEN} + image: python:3.12-alpine + +pre_commit: + stage: linting + script: + - apk add git + - pip install --root-user-action ignore pre-commit + - pre-commit run -a build_image: stage: build @@ -17,6 +22,8 @@ build_image: - docker variables: CONTAINER_NAME: ${CI_REGISTRY_IMAGE}/facturio + before_script: + - docker login ${CI_REGISTRY} -u gitlab-ci-token -p ${CI_JOB_TOKEN} script: - docker build -t ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} . - docker push ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} -- 2.45.2 From 928b28845bee6715877b04209370adff89b8fcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Mon, 19 Aug 2024 22:39:09 +0200 Subject: [PATCH 10/11] development docker-compose.yml for database and stuff --- .dockerignore | 2 ++ Dockerfile | 36 +++++++++++++++++++++++++++++++----- docker-compose.yml | 14 ++++++++++++++ scripts/run-dev.sh | 4 ++++ scripts/run.sh | 4 ++++ 5 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 docker-compose.yml create mode 100644 scripts/run-dev.sh diff --git a/.dockerignore b/.dockerignore index 9eb9db7..7468f88 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,5 @@ .idea/ *.drawio .ruff_cache/ +*.sqlite3 +*.db diff --git a/Dockerfile b/Dockerfile index f265651..4596fe4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,9 @@ FROM python:${PYTHON_VERSION}-alpine AS base ENV PYTHONUNBUFFERED=1 \ PIP_DISABLE_PIP_VERSION_CHECK=on \ - DEBIAN_FRONTEND=noninteractive \ POETRY_VIRTUALENVS_CREATE=false \ VENV=/root/.venv - RUN adduser --disabled-password --gecos "" django FROM base AS poetry @@ -19,6 +17,8 @@ RUN : \ && python -m venv ${VENV} \ && . ${VENV}/bin/activate \ && pip install poetry==${POETRY_VERSION} \ + && apk add gettext shadow \ + && apk -v cache clean \ && : ENV PATH="${VENV}/bin:${PATH}" @@ -33,11 +33,32 @@ RUN poetry install --no-interaction --no-ansi -vvv COPY scripts/ /usr/local/tmp-bin -RUN chmod +x /usr/local/tmp-bin/* \ +RUN : \ + && chmod +x /usr/local/tmp-bin/* \ && mv /usr/local/tmp-bin/* /usr/local/bin \ - && rmdir /usr/local/tmp-bin + && rmdir /usr/local/tmp-bin \ + && : ENTRYPOINT ["entrypoint.sh"] +CMD ["run.sh"] + +FROM deps AS development + +WORKDIR /app + +ARG GID=1000 +ARG UID=1000 + +RUN : \ + && groupmod django -g $GID \ + && usermod django -u $UID -g $GID \ + && : + +COPY --chown=django . . + +USER django + +CMD ["run-dev.sh"] FROM deps AS production @@ -45,4 +66,9 @@ WORKDIR /app COPY --chown=django . . -CMD ["run.sh"] +USER django + +RUN : \ + && ./manage.py compilemessages \ + && ./manage.py collectstatic --noinput \ + && : diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..584ef4c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +services: + api: + image: facturio + build: + context: . + dockerfile: Dockerfile + args: + GID: ${GID:-1000} + UID: ${UID:-1000} + target: development + ports: + - "8000:8000" + volumes: + - .:/app:Z diff --git a/scripts/run-dev.sh b/scripts/run-dev.sh new file mode 100644 index 0000000..b8c35b8 --- /dev/null +++ b/scripts/run-dev.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +./manage.py migrate +./manage.py runserver 0.0.0.0:8000 diff --git a/scripts/run.sh b/scripts/run.sh index 85477fa..a791c3a 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,5 +1,9 @@ #/bin/sh +echo "Migrating..." +./manage.py migrate >/dev/null + + gunicorn \ --threads 2 \ --workers 4 \ -- 2.45.2 From bef7f44a1d848f04c3abb09a5322a880b4d26c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Mon, 19 Aug 2024 22:42:51 +0200 Subject: [PATCH 11/11] build yaml --- .gitlab-ci.yml | 10 +++++----- docker-compose.build.yml | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 docker-compose.build.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f416545..99705f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,14 +21,14 @@ build_image: services: - docker variables: - CONTAINER_NAME: ${CI_REGISTRY_IMAGE}/facturio + COMPOSE_FILE: docker-compose.build.yml before_script: - docker login ${CI_REGISTRY} -u gitlab-ci-token -p ${CI_JOB_TOKEN} script: - - docker build -t ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} . - - docker push ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} + - docker compose build + - docker compose push - | if [[ -n "${CI_COMMIT_TAG}" ]]; then - docker tag ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} ${CONTAINER_NAME}:${CI_COMMIT_TAG} - docker push ${CONTAINER_NAME}:${CI_COMMIT_TAG} + docker tag ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_TAG} + docker push ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_TAG} fi diff --git a/docker-compose.build.yml b/docker-compose.build.yml new file mode 100644 index 0000000..45efcc2 --- /dev/null +++ b/docker-compose.build.yml @@ -0,0 +1,7 @@ +services: + api: + image: ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} + build: + context: . + dockerfile: Dockerfile + target: production -- 2.45.2