forked from grapeot/VoiceNoteTaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support 2 processes running in docker
Support 2 processes running in docker
- Loading branch information
1 parent
d989ef4
commit 0c991fa
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
FROM python:3.9 | ||
RUN apt-get update && apt-get install -y build-essential ffmpeg | ||
RUN apt-get update && apt-get install -y build-essential supervisor ffmpeg | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
# RUN chmod +x *.sh | ||
COPY requirements.txt . | ||
RUN pip install --user -r requirements.txt | ||
|
||
ENV PATH=/root/.local/bin:$PATH | ||
ENV OPENAI_API_KEY your_api_key | ||
ENV TELEGRAM_BOT_TOKEN your_bot_token | ||
ENV FLASK_APP=main.py | ||
COPY . /app | ||
WORKDIR /app | ||
CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"] | ||
|
||
# CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"] | ||
# CMD ["python3", "telegram_bot.py"] | ||
|
||
CMD ["/usr/bin/supervisord"] # ideally to use multiple containers for multiple python processes, but Railway does not support so with docker-compose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[supervisord] | ||
nodaemon=true | ||
|
||
[program:app] | ||
directory=/app/ | ||
command=flask run --host=0.0.0.0 --port=5000 | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stdout | ||
stderr_logfile_maxbytes=0 | ||
|
||
[program:worker] | ||
directory=/app/ | ||
command=python3 telegram_bot.py | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stdout | ||
stderr_logfile_maxbytes=0 |