Skip to content

Commit

Permalink
Merge pull request #34 from AdriYP/Vladimir_ci_cd
Browse files Browse the repository at this point in the history
202410190029
  • Loading branch information
GreenVibesOnly authored Oct 18, 2024
2 parents c75329b + f780bc6 commit 6ceb26f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.0-slim
FROM python:3.12.0
WORKDIR /app

# Установка необходимых системных зависимостей (если нужно)
Expand All @@ -13,20 +13,17 @@ RUN curl -sSL https://install.python-poetry.org | python3 -
# Установка пути для Poetry
ENV PATH="/root/.local/bin:$PATH"

# Копирование только pyproject.toml и poetry.lock (если есть) для кэширования зависимостей
COPY pyproject.toml poetry.lock* ./
# Копирование только pyproject.toml
COPY pyproject.toml ./

# указываем poetry использовать venv проекта
RUN poetry config virtualenvs.in-project true

# Установка зависимостей
RUN poetry install --no-root

# Копирование остальных файлов, включая alembic
COPY . .

# Создание миграций
#WORKDIR /app/app
#RUN poetry run alembic stamp head
#RUN poetry run alembic revision --autogenerate -m "compose commit"
#RUN poetry run alembic upgrade head

# Команда для запуска приложения
CMD ["poetry", "run", "python", "app/main.py"]
11 changes: 10 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ volumes:
pg_data:

services:
redis:
image: redis:latest
container_name: redis_container
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '6379:6379'
volumes:
- ./redisdata:/data
db:
container_name: scid-db
image: postgres:13
Expand All @@ -15,5 +24,5 @@ services:
container_name: scid-bot
# build: . # раскомментить для работы локально
image: greenvibe/scid_bot_3
command: bash -c "cd app && poetry run alembic upgrade head && poetry run python main.py" # poetry run alembic stamp head && poetry run alembic revision --autogenerate &&
command: bash -c "cd app && poetry run alembic upgrade head && poetry run python main.py"
env_file: .env
Binary file added redisdata/dump.rdb
Binary file not shown.

0 comments on commit 6ceb26f

Please sign in to comment.