docker: install unzip

This commit is contained in:
Fam Zheng 2025-11-05 15:35:40 +00:00
parent 2aceaf33a4
commit 94b66e66c5
2 changed files with 14 additions and 3 deletions

View File

@ -14,6 +14,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
vim \ vim \
wget \ wget \
zip \ zip \
unzip \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
ADD requirements.txt requirements.txt ADD requirements.txt requirements.txt
RUN rm -f /usr/lib/python*/EXTERNALLY-MANAGED && \ RUN rm -f /usr/lib/python*/EXTERNALLY-MANAGED && \

View File

@ -27,17 +27,27 @@ def main():
gunicorn_args = os.environ.get("GUNICORN_ARGS", "").split() gunicorn_args = os.environ.get("GUNICORN_ARGS", "").split()
gunicorn_log = '/emblem/log/gunicorn.log' gunicorn_log = '/emblem/log/gunicorn.log'
subprocess.check_output(['touch', gunicorn_log]) subprocess.check_output(['touch', gunicorn_log])
# Use tee to write logs to both file and stderr
tee = subprocess.Popen(['tee', '-a', gunicorn_log],
stdin=subprocess.PIPE,
stdout=sys.stderr)
gunicorn = subprocess.Popen(['gunicorn', gunicorn = subprocess.Popen(['gunicorn',
'-b', '127.0.0.1:28266', '-b', '127.0.0.1:28266',
'-b', 'unix:/tmp/gunicorn.sock', '-b', 'unix:/tmp/gunicorn.sock',
'--log-level=info', '--log-level=info',
'--log-file=' + gunicorn_log, '--access-logfile=-', # Log to stdout
'--error-logfile=-', # Log to stdout
'-w', '8', '-w', '8',
'-t', '0', '-t', '0',
'emblemapi.wsgi:application' 'emblemapi.wsgi:application'
] + gunicorn_args, cwd=os.path.join(BASE_DIR, 'api')) ] + gunicorn_args,
cwd=os.path.join(BASE_DIR, 'api'),
stdout=tee.stdin,
stderr=subprocess.STDOUT)
procs = [nginx, gunicorn] procs = [nginx, gunicorn, tee]
atexit.register(lambda: [x.kill() for x in procs]) atexit.register(lambda: [x.kill() for x in procs])
print("Started nginx and gunicorn, entering infinite loop") print("Started nginx and gunicorn, entering infinite loop")