49 lines
933 B
Docker
49 lines
933 B
Docker
FROM node:alpine as frontend
|
|
|
|
WORKDIR /usr/src/app/frontend/
|
|
|
|
COPY frontend .
|
|
|
|
RUN yarn install \
|
|
&& yarn build
|
|
|
|
FROM python:3-alpine as requirements
|
|
|
|
WORKDIR /usr/src/app/
|
|
|
|
RUN apk add --no-cache git \
|
|
&& pip install --no-cache-dir pipenv
|
|
|
|
COPY Pipfile .
|
|
COPY Pipfile.lock .
|
|
|
|
RUN pipenv lock -r > requirements.txt
|
|
|
|
FROM python:3-alpine
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY --from=requirements /usr/src/app/requirements.txt .
|
|
|
|
RUN apk add --no-cache --virtual .deps \
|
|
build-base \
|
|
git \
|
|
libffi-dev \
|
|
libjpeg-turbo-dev \
|
|
libwebp-dev \
|
|
zlib-dev \
|
|
&& pip install -r requirements.txt \
|
|
&& apk del .deps \
|
|
&& apk add --no-cache \
|
|
libffi \
|
|
libjpeg-turbo \
|
|
libwebp
|
|
|
|
COPY --from=frontend /usr/src/app/frontend/dist/ frontend/dist
|
|
|
|
COPY [^frontend]* ./
|
|
|
|
ENTRYPOINT ["gunicorn", "mangareader:app", "--bind", "0.0.0.0:8000", "--chdir", "/library"]
|
|
|
|
EXPOSE 8000
|