2021-01-05 07:32:52 +00:00
|
|
|
FROM node:latest AS builder
|
2021-01-11 06:05:59 +00:00
|
|
|
ADD https://git.tanshu.com/api/v1/repos/tanshu/luthor/branches/main /main.json
|
2021-01-11 06:11:36 +00:00
|
|
|
RUN git clone --single-branch --depth 1 --branch main https://git.tanshu.com/tanshu/luthor.git /app
|
2021-01-11 06:05:59 +00:00
|
|
|
WORKDIR /app/otis
|
|
|
|
RUN npm install --unsafe-perm --legacy-peer-deps && /app/otis/node_modules/.bin/ng build --prod
|
2021-01-05 07:32:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
FROM python:latest
|
|
|
|
LABEL maintainer="Amritanshu <docker@tanshu.com>"
|
|
|
|
|
2021-01-11 06:05:59 +00:00
|
|
|
COPY --from=builder /app/luthor /app
|
2021-01-05 07:32:52 +00:00
|
|
|
COPY --from=builder /app/frontend /app/frontend
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
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 ["python", "-m", "luthor"]
|