This repository has been archived on 2022-06-28. You can view files and clone it, but cannot push or open issues or pull requests.
Yotter/Dockerfile

38 lines
821 B
Docker
Raw Normal View History

2020-09-11 18:18:06 +05:30
FROM python:3-alpine AS base
# Image to Build Dependencies
FROM base AS builder
2020-09-04 01:57:08 +05:30
WORKDIR /usr/src/app
COPY ./requirements.txt /usr/src/app
2020-09-08 12:46:57 +05:30
2020-09-11 15:06:41 +05:30
# Build Dependencies
2020-09-11 15:13:49 +05:30
RUN apk --no-cache add gcc musl-dev libffi-dev openssl-dev libxml2-dev libxslt-dev file llvm-dev make g++
2020-09-11 15:06:41 +05:30
# Python Dependencies
RUN pip install --no-cache-dir --prefix=/install wheel cryptography gunicorn pymysql
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
2020-09-11 18:18:06 +05:30
# Runtime Environment Image
FROM base
2020-09-11 15:06:41 +05:30
WORKDIR /usr/src/app
# Runtime Dependencies
RUN apk --no-cache add libxml2 libxslt
COPY --from=builder /install /usr/local
2020-09-09 11:55:52 +05:30
2020-09-04 01:57:08 +05:30
COPY . .
2020-09-04 21:42:24 +05:30
RUN flask db init \
&& flask db migrate \
2020-09-04 21:42:24 +05:30
&& flask db upgrade
2020-09-04 01:57:08 +05:30
CMD flask db stamp head \
&& flask db migrate \
&& flask db upgrade \
&& gunicorn -b 0.0.0.0:5000 -w 4 yotter:app
2020-09-04 01:57:08 +05:30
EXPOSE 5000