docker: install unzip
This commit is contained in:
parent
2aceaf33a4
commit
94b66e66c5
@ -14,6 +14,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
|
||||
vim \
|
||||
wget \
|
||||
zip \
|
||||
unzip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
ADD requirements.txt requirements.txt
|
||||
RUN rm -f /usr/lib/python*/EXTERNALLY-MANAGED && \
|
||||
|
||||
@ -27,17 +27,27 @@ def main():
|
||||
gunicorn_args = os.environ.get("GUNICORN_ARGS", "").split()
|
||||
gunicorn_log = '/emblem/log/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',
|
||||
'-b', '127.0.0.1:28266',
|
||||
'-b', 'unix:/tmp/gunicorn.sock',
|
||||
'--log-level=info',
|
||||
'--log-file=' + gunicorn_log,
|
||||
'--access-logfile=-', # Log to stdout
|
||||
'--error-logfile=-', # Log to stdout
|
||||
'-w', '8',
|
||||
'-t', '0',
|
||||
'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])
|
||||
|
||||
print("Started nginx and gunicorn, entering infinite loop")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user