You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
599 B
Docker
33 lines
599 B
Docker
3 years ago
|
# Base Image
|
||
3 years ago
|
FROM python:3.10.0-buster
|
||
3 years ago
|
|
||
3 years ago
|
RUN apt-get update && apt-get install -y tini
|
||
|
|
||
3 years ago
|
ENV APP_HOME=/opt/app
|
||
|
|
||
|
# Create directory for the app
|
||
|
RUN mkdir $APP_HOME
|
||
|
WORKDIR $APP_HOME
|
||
|
|
||
|
# Create the app user
|
||
|
RUN groupadd app && useradd -g app app
|
||
|
|
||
|
# Install Requirements
|
||
|
COPY requirements.txt .
|
||
|
|
||
|
RUN pip install --no-cache -r requirements.txt
|
||
|
|
||
|
# Install app
|
||
3 years ago
|
COPY wsgi.py ./
|
||
|
COPY api/ ./api/
|
||
3 years ago
|
|
||
|
# Chown all the files to the app user
|
||
|
RUN chown -R app:app $APP_HOME
|
||
|
|
||
|
# Change to the app user
|
||
|
USER app
|
||
|
|
||
3 years ago
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||
|
|
||
3 years ago
|
CMD ["gunicorn", "--log-level=debug", "-b", "0.0.0.0:5000", "wsgi:app"]
|