diff --git a/.github/workflows/poetry-test.yml b/.github/workflows/poetry-test.yml index ce7eb07..1690bcb 100644 --- a/.github/workflows/poetry-test.yml +++ b/.github/workflows/poetry-test.yml @@ -37,6 +37,7 @@ jobs: curl -sSL "https://install.python-poetry.org" | python - # Adding `poetry` to `$PATH`: echo "$HOME/.local/bin" >> $GITHUB_PATH + apt-get update && apt-get install --no-install-recommends -y ffmpeg - name: Set up cache uses: actions/cache@v3 @@ -59,7 +60,7 @@ jobs: run: | poetry config virtualenvs.in-project true poetry install - poetry run pip install -U pip ffmpeg + poetry run pip install -U pip #---------------------------------------------- # run test suite #---------------------------------------------- diff --git a/README.md b/README.md index 7f9a944..3e95837 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,16 @@ gunicorn main:create_app --workers 10 --bind 0.0.0.0:8083 --worker-class uvicorn ## Tests +### Run local tests: ```bash poetry run pytest ``` +### Run tests in docker compose: +```bash +docker compose run bot poetry run pytest bot_microservice/ +``` + ## Docs Docs can be found at diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 53d5c28..85f63bc 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -21,6 +21,7 @@ RUN printf "================ Start build base service. with USER: ${USER} ====== curl \ git \ nano \ + ffmpeg \ # Cleaning cache: && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && apt-get clean -y && rm -rf /var/lib/apt/lists/* @@ -35,10 +36,10 @@ RUN if [ "$USER" != "root" ]; then \ COPY --chown=${USER}:${USER} ../poetry.lock ../pyproject.toml /app/ -RUN pip install --upgrade pip && pip install poetry==$POETRY_VERSION && pip install ffmpeg +RUN pip install --upgrade pip && pip install poetry==$POETRY_VERSION RUN poetry config virtualenvs.in-project true && \ poetry config virtualenvs.create true && \ - poetry install --only main --no-interaction --no-ansi && \ + poetry install $(if [ "$USER" != "root" ]; then echo "--only main"; fi) --no-interaction --no-ansi && \ rm -rf $POETRY_CACHE_DIR