mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2025-09-11 22:30:41 +03:00
add root option for poetry to Dockerfile (#10)
This commit is contained in:
parent
38932d0ba9
commit
e8ace80d68
3
.github/workflows/poetry-test.yml
vendored
3
.github/workflows/poetry-test.yml
vendored
@ -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
|
||||
#----------------------------------------------
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user