2020-12-14 12:28:00 +00:00
|
|
|
FROM node:latest AS builder
|
|
|
|
ADD https://git.tanshu.com/api/v1/repos/tanshu/barker/tags /tags.json
|
|
|
|
RUN git clone --single-branch --depth 1 --branch latest https://git.tanshu.com/tanshu/barker.git /app
|
|
|
|
WORKDIR /app/bookie
|
2021-03-18 11:13:22 +00:00
|
|
|
RUN npm install --unsafe-perm && /app/bookie/node_modules/.bin/ng build --prod
|
2020-12-14 12:28:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
FROM python:latest
|
|
|
|
LABEL maintainer="Amritanshu <docker@tanshu.com>"
|
2020-12-15 16:45:51 +00:00
|
|
|
|
2021-06-21 07:07:49 +00:00
|
|
|
ADD https://git.tanshu.com/tanshu/barker/raw/tag/latest/barker/pyproject.toml /app/pyproject.toml
|
2020-12-16 06:19:22 +00:00
|
|
|
|
2020-12-15 16:45:51 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y locales && \
|
|
|
|
sed --in-place --expression='s/# en_IN UTF-8/en_IN UTF-8/' /etc/locale.gen && \
|
|
|
|
dpkg-reconfigure --frontend=noninteractive locales
|
|
|
|
|
|
|
|
ENV LANG en_IN
|
|
|
|
ENV LC_ALL en_IN
|
|
|
|
|
2020-12-14 12:28:00 +00:00
|
|
|
# Install Poetry
|
2021-06-19 07:01:48 +00:00
|
|
|
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | POETRY_HOME=/opt/poetry python && \
|
2020-12-14 12:28:00 +00:00
|
|
|
cd /usr/local/bin && \
|
|
|
|
ln -s /opt/poetry/bin/poetry && \
|
|
|
|
poetry config virtualenvs.create false
|
|
|
|
|
2021-06-21 07:07:49 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-12-14 12:28:00 +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"
|
|
|
|
|
2021-06-21 07:07:49 +00:00
|
|
|
COPY --from=builder /app/barker /app
|
|
|
|
COPY --from=builder /app/frontend /app/frontend
|
|
|
|
|
2020-12-14 12:28:00 +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"]
|
|
|
|
|
2021-06-19 07:01:48 +00:00
|
|
|
CMD ["poetry", "run", "python", "-m", "barker"]
|