Added the docker files and ansible playbooks for two instances namely pkl and chd.

This commit is contained in:
2020-12-14 17:58:00 +05:30
parent 294f53147f
commit 4f5ba47d46
12 changed files with 341 additions and 9 deletions

33
docker/app/Dockerfile Normal file
View File

@ -0,0 +1,33 @@
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>"
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"]

View File

@ -0,0 +1,24 @@
FROM python:latest
LABEL maintainer="Amritanshu <docker@tanshu.com>"
RUN git clone --single-branch --depth 1 --branch latest https://git.tanshu.com/tanshu/barker.git /repo
RUN mkdir /app && mv /repo/barker/* /app
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 C_FORCE_ROOT=1
ENV PYTHONPATH=/app
RUN chmod 777 /app/worker-start.sh \
&& ln -s /app/worker-start.sh /usr/local/bin/worker-start.sh \
&& ln -s /app/worker-start.sh /
CMD ["bash", "worker-start.sh"]