Merge branch 'main' into beta

This commit is contained in:
Choco
2024-07-26 13:14:33 +08:00
3 changed files with 26 additions and 6 deletions

4
.gitignore vendored
View File

@@ -1,5 +1,5 @@
Vocard.rar
.env
*.pyc
logs
settings.json
settings.json
logs

View File

@@ -1,8 +1,8 @@
# Use an official Python runtime as a base image
FROM python:3.12-slim
# Install build dependencies
RUN apt-get update -y && apt-get install -y gcc python3-dev
# Install build dependencies and supervisor
RUN apt-get update -y && apt-get install -y gcc python3-dev supervisor
# Set the working directory to /app
WORKDIR /app
@@ -13,5 +13,8 @@ COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Run main.py when the container launches
CMD ["python", "-u", "main.py"]
# Copy the supervisor configuration file
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Run supervisor to manage both processes main.py and webapp.py
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

17
supervisord.conf Normal file
View File

@@ -0,0 +1,17 @@
[supervisord]
nodaemon=true
user=root
[program:main]
command=python -u /app/main.py
autostart=true
autorestart=true
stderr_logfile=/var/log/main.err.log
stdout_logfile=/var/log/main.out.log
[program:webapp]
command=python -u /app/web/webapp.py
autostart=true
autorestart=true
stderr_logfile=/var/log/webapp.err.log
stdout_logfile=/var/log/webapp.out.log