playbooks/brewman/app/Dockerfile
tanshu ed8feff302 New:
Fastapi Brewman
  Fastapi Barker
2020-10-17 12:27:59 +05:30

33 lines
1.1 KiB
Docker

FROM node:latest AS builder
RUN git clone --single-branch --depth 1 --branch latest https://git.tanshu.com/tanshu/brewman.git /app
WORKDIR /app/overlord
RUN npm install --unsafe-perm && /app/overlord/node_modules/.bin/ng build --prod
FROM python:latest
LABEL maintainer="Amritanshu <docker@tanshu.com>"
COPY --from=builder /app/brewman /app
COPY --from=builder /app/frontend /app/frontend
WORKDIR /app/brewman
# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# Allow installing dev dependencies to run tests
ARG INSTALL_DEV=false
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi"
ENV PYTHONPATH=/app
EXPOSE 80
VOLUME /frontend
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod 777 /usr/local/bin/docker-entrypoint.sh \
&& ln -s /usr/local/bin/docker-entrypoint.sh /
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["python", "-m", "brewman"]