brewman/docker/app/Dockerfile

38 lines
1.3 KiB
Docker
Raw Normal View History

2020-11-03 05:53:48 +00:00
FROM node:latest AS builder
ADD https://git.tanshu.com/api/v1/repos/tanshu/brewman/tags /tags.json
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
2020-11-03 05:53:48 +00:00
FROM python:latest
LABEL maintainer="Amritanshu <docker@tanshu.com>"
ADD https://git.tanshu.com/tanshu/brewman/raw/tag/latest/brewman/pyproject.toml /app/pyproject.toml
2020-11-03 05:53:48 +00:00
# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | POETRY_HOME=/opt/poetry python && \
2020-11-03 05:53:48 +00:00
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
WORKDIR /app
2020-11-03 05:53:48 +00:00
# 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"
COPY --from=builder /app/brewman /app
COPY --from=builder /app/frontend /app/frontend
2020-11-03 05:53:48 +00:00
ENV PYTHONPATH=/app
EXPOSE 80
VOLUME /frontend
RUN chmod 777 /app/docker-entrypoint.sh \
&& ln -s /app/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh \
&& ln -s /app/docker-entrypoint.sh /
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["poetry", "run", "python", "-m", "brewman"]