2020-11-03 05:53:48 +00:00
|
|
|
FROM node:latest AS builder
|
2021-10-31 13:17:25 +00:00
|
|
|
RUN mkdir -p /app/overlord
|
|
|
|
COPY package.json /app/overlord/package.json
|
|
|
|
RUN cd /app/overlord \
|
|
|
|
&& npm install --unsafe-perm \
|
|
|
|
&& mv /app/overlord/node_modules / \
|
|
|
|
&& cd / \
|
|
|
|
&& rm -rf /app
|
2020-11-03 05:53:48 +00:00
|
|
|
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
|
2023-08-04 10:49:23 +00:00
|
|
|
RUN mv /node_modules /app/overlord/ \
|
|
|
|
&& /app/overlord/node_modules/.bin/ng build
|
2020-11-03 05:53:48 +00:00
|
|
|
|
|
|
|
|
2023-01-31 12:21:20 +00:00
|
|
|
FROM python:3.11
|
2020-11-03 05:53:48 +00:00
|
|
|
LABEL maintainer="Amritanshu <docker@tanshu.com>"
|
2021-09-10 16:16:47 +00:00
|
|
|
|
2021-10-31 13:17:25 +00:00
|
|
|
COPY pyproject.toml /app/pyproject.toml
|
|
|
|
|
|
|
|
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-11-03 05:53:48 +00:00
|
|
|
|
|
|
|
# Install Poetry
|
2023-07-23 03:31:18 +00:00
|
|
|
RUN curl -sSL https://install.python-poetry.org | 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
|
|
|
|
|
2021-09-10 16:16:47 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-11-03 05:53:48 +00:00
|
|
|
# Allow installing dev dependencies to run tests
|
|
|
|
ARG INSTALL_DEV=false
|
2023-01-31 12:21:20 +00:00
|
|
|
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --only main ; fi"
|
2020-11-03 05:53:48 +00:00
|
|
|
|
2021-09-10 16:16:47 +00:00
|
|
|
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"]
|
|
|
|
|
2023-08-06 03:39:02 +00:00
|
|
|
CMD ["poetry", "run", "gunicorn", "brewman.main:app", "--worker-class", "uvicorn.workers.UvicornWorker", "--config", "/app/gunicorn.conf.py", "--log-config", "/app/logging.conf"]
|