2021-02-16 19:28:30 +01:00
|
|
|
FROM python:3.9-slim-buster
|
2021-02-11 23:18:12 +01:00
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
# dependencies for building Python packages
|
|
|
|
&& apt-get install -y build-essential \
|
|
|
|
# psycopg2 dependencies
|
|
|
|
&& apt-get install -y libpq-dev \
|
|
|
|
# Translations dependencies
|
|
|
|
&& apt-get install -y gettext \
|
|
|
|
# Git
|
|
|
|
&& apt-get install -y git \
|
|
|
|
# cleaning up unused files
|
|
|
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Requirements are installed here to ensure they will be cached.
|
|
|
|
COPY ./dev.requirements.txt /app/dev.requirements.txt
|
|
|
|
COPY ./tuxbot /app/tuxbot
|
2021-02-16 19:28:30 +01:00
|
|
|
COPY ./data /app/data
|
2021-02-11 23:18:12 +01:00
|
|
|
COPY ./setup.cfg /app/setup.cfg
|
|
|
|
COPY ./setup.py /app/setup.py
|
|
|
|
RUN pip install -r /app/dev.requirements.txt
|
|
|
|
RUN pip install ./app
|
|
|
|
|
|
|
|
COPY ./compose/production/tuxbot/entrypoint /entrypoint
|
|
|
|
RUN sed -i 's/\r$//g' /entrypoint
|
|
|
|
RUN chmod +x /entrypoint
|
|
|
|
|
|
|
|
COPY ./compose/local/tuxbot/start /start
|
|
|
|
RUN sed -i 's/\r$//g' /start
|
|
|
|
RUN chmod +x /start
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
ENTRYPOINT ["/entrypoint"]
|