Flask -> FastAPI rewrite
This commit is contained in:
34
Dockerfile
34
Dockerfile
@ -1,8 +1,30 @@
|
||||
FROM python:3-alpine as base
|
||||
WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN pip install --compile --no-cache-dir --requirement requirements.txt
|
||||
COPY . /app
|
||||
|
||||
CMD ["gunicorn", "-c", "gunicorn.py"]
|
||||
#CMD python app.py
|
||||
WORKDIR /app
|
||||
|
||||
# Code from https://github.com/nginxinc/docker-nginx/blob/4bf0763f4977fff7e9648add59e0540088f3ca9f/stable/alpine-slim/Dockerfile
|
||||
|
||||
ENV NGINX_VERSION 1.25.3
|
||||
ENV PKG_RELEASE 1
|
||||
|
||||
COPY compose/nginx/install.sh /
|
||||
RUN /bin/sh /install.sh \
|
||||
&& rm /install.sh
|
||||
|
||||
# Python part
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt gunicorn
|
||||
COPY service service
|
||||
|
||||
COPY compose/docker-entrypoint.sh /
|
||||
COPY compose/nginx/default.conf /etc/nginx/conf.d/
|
||||
COPY compose/nginx/docker-entrypoint.d /docker-entrypoint.d
|
||||
COPY assets /usr/share/nginx/html
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
#CMD ["gunicorn", "-c", "/app/service/gunicorn.py"]
|
||||
CMD ["uvicorn", "service.app:app", "--host", "0.0.0.0", "--port", "5000", "--proxy-headers", "--no-server-header"]
|
Reference in New Issue
Block a user