first commit
This commit is contained in:
@ -1,12 +1,19 @@
|
|||||||
FROM python:3.10-alpine AS final
|
FROM python:3.10-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy only installed dependencies + app
|
# Use a faster mirror + install dependencies
|
||||||
COPY --from=builder /install /usr/local
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirror.kakao.com/mirror.kakao.com/g' /etc/apk/repositories \
|
||||||
COPY --from=builder /app /app
|
&& apk add --no-cache gcc musl-dev python3-dev mariadb-dev libffi-dev openssl-dev
|
||||||
|
|
||||||
# Production ENV
|
# Copy requirements and install
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy app code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Production environment
|
||||||
ENV FLASK_ENV=production
|
ENV FLASK_ENV=production
|
||||||
ENV FLASK_APP=run.py
|
ENV FLASK_APP=run.py
|
||||||
ENV FLASK_RUN_HOST=0.0.0.0
|
ENV FLASK_RUN_HOST=0.0.0.0
|
||||||
@ -14,5 +21,5 @@ ENV FLASK_RUN_PORT=5000
|
|||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# Use Gunicorn for production
|
# Use Gunicorn
|
||||||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "run:app"]
|
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "run:app"]
|
||||||
|
|||||||
Reference in New Issue
Block a user