barker/docker/app/Dockerfile
tanshu 22de4f7624 Fix: Reports were not working as they were not adapted to the new Enums
Fix: The docker image borked on printing as it did not have the en_IN locale
Fix: Angular errored as it needed typescript < 4.1.0
Fix: chd yml had a typo in host name
2020-12-15 22:15:51 +05:30

43 lines
1.4 KiB
Docker

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
RUN npm install --unsafe-perm --legacy-peer-deps && /app/bookie/node_modules/.bin/ng build --prod
FROM python:latest
LABEL maintainer="Amritanshu <docker@tanshu.com>"
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
COPY --from=builder /app/barker /app
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", "barker"]