mirror of
https://github.com/ijaric/voice_assistant.git
synced 2025-05-24 14:33:26 +00:00
fix: [#49] docker-compose from template
This commit is contained in:
parent
8297e13b32
commit
2d0cdb638c
|
@ -1,15 +1,22 @@
|
||||||
FROM python:3.11
|
FROM python:3.11
|
||||||
ENV BOT_NAME=$BOT_NAME
|
|
||||||
|
|
||||||
WORKDIR /usr/src/app/"${BOT_NAME:-tg_bot}"
|
RUN apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
|
&& apt-get install -y net-tools netcat-traditional curl \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY pyproject.toml /usr/src/app/"${BOT_NAME:-tg_bot}"/pyproject.toml
|
RUN mkdir --parents /opt/app
|
||||||
COPY poetry.lock /usr/src/app/"${BOT_NAME:-tg_bot}"//poetry.lock
|
COPY pyproject.toml /opt/app/pyproject.toml
|
||||||
COPY poetry.toml /usr/src/app/"${BOT_NAME:-tg_bot}"/poetry.toml
|
COPY poetry.lock /opt/app/poetry.lock
|
||||||
|
COPY poetry.toml /opt/app/poetry.toml
|
||||||
|
|
||||||
WORKDIR /usr/src/app/"${BOT_NAME:-tg_bot}"
|
WORKDIR /opt/app
|
||||||
|
|
||||||
RUN pip install poetry \
|
RUN pip install poetry \
|
||||||
&& poetry install --no-dev
|
&& poetry install --no-dev
|
||||||
|
|
||||||
COPY . /usr/src/app/"${BOT_NAME:-tg_bot}"
|
COPY bin /opt/app/bin
|
||||||
|
COPY tgbot /opt/app/tgbot
|
||||||
|
|
||||||
|
CMD [".venv/bin/python", "-m", "bin"]
|
||||||
|
|
|
@ -1,22 +1,17 @@
|
||||||
version: "3.3"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
bot:
|
bot:
|
||||||
image: "${BOT_IMAGE_NAME:-tg_bot-image}"
|
image: "${BOT_IMAGE_NAME:-tg_bot-image}"
|
||||||
container_name: "${BOT_CONTAINER_NAME:-tg_bot-container}"
|
container_name: "${BOT_CONTAINER_NAME:-tg_bot-container}"
|
||||||
stop_signal: SIGINT
|
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
working_dir: "/usr/src/app/${BOT_NAME:-tg_bot}"
|
|
||||||
volumes:
|
|
||||||
- .:/usr/src/app/${BOT_NAME:-tg_bot}
|
|
||||||
command: poetry run python bot.py
|
|
||||||
restart: always
|
restart: always
|
||||||
env_file:
|
env_file:
|
||||||
- ".env"
|
- .env
|
||||||
networks:
|
networks:
|
||||||
- tg_bot
|
- tg_bot_network
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
tg_bot:
|
tg_bot_network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
Loading…
Reference in New Issue
Block a user