fixed ci
Code Quality Pipeline / Test (push) Successful in 4m3s
CI Pipeline / Test (pull_request) Successful in 4m14s
CI Pipeline / Build and Publish (pull_request) Failing after 14s

This commit is contained in:
Brian Bjarke Jensen
2024-05-20 22:10:54 +02:00
parent 7d723285c8
commit a500e8a687
2 changed files with 1 additions and 67 deletions
+1 -2
View File
@@ -44,8 +44,7 @@ jobs:
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: .
dockerfile: ./web_ui/
context: ./web_ui/
push: true
tags: |
${{ vars.docker_repo_url }}/${{ gitea.repository }}/web_ui:${{ env.sha_short }}
-65
View File
@@ -1,65 +0,0 @@
###########
# BUILDER #
###########
# pull official base image
FROM python:3.12-slim-bullseye as BUILDER
# set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=ON \
PIP_DEFAULT_TIMEOUT=100 \
DEBIAN_FRONTEND=noninteractive \
POETRY_HOME=/etc/poetry \
POETRY_VERSION=1.7.1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_NO_INTERACTION=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache \
APP_HOME=/home/app
# update system
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
curl \
&& apt-get clean
# install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="${POETRY_HOME}/bin:$PATH"
# install runtime dependencies
WORKDIR ${APP_HOME}
COPY poetry.lock pyproject.toml ./
RUN --mount=type=cache,target=${POETRY_CACHE_DIR} poetry install
#########
# FINAL #
#########
# pull official base image
FROM python:3.12-slim-bullseye
# copy virtualenv made by poetry
ENV APP_HOME=/home/app \
VIRTUAL_ENV=/home/app/.venv
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
# create home directory and app user
RUN mkdir -p /home/app && \
addgroup --system app && \
adduser --system --group app
# add code while changing ownership
WORKDIR $APP_HOME
COPY --chown=app:app ./src ./src
COPY --chown=app:app ./core ./core
# change to the app user
USER app
ENTRYPOINT [ "gunicorn", "src.main:server", "-b", "0.0.0.0:8050" ]