1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-11 16:01:20 +00:00
bramw_baserow/backend/docker/Dockerfile.dev

55 lines
2 KiB
Text

FROM python:3.7-slim-buster
# Default to 1000 as this is probably the running users UID.
ARG UID
ENV UID=${UID:-1000}
ARG GID
ENV GID=${GID:-1000}
# We might be running as a user which already exists in this image. In that situation
# Everything is OK and we should just continue on.
RUN groupadd -g $GID baserow_docker_group || exit 0
RUN useradd --shell /bin/bash -u $UID -g $GID -o -c "" -m baserow_docker_user || exit 0
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
gnupg2 \
libpq-dev \
dos2unix \
tini \
postgresql-client \
gettext \
&& apt-get autoclean \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
USER $UID:$GID
COPY --chown=$UID:$GID ./backend/requirements /baserow/requirements
# In slim docker images, mime.types is removed and we need it for mimetypes guessing
COPY --chown=$UID:$GID ./backend/docker/mime.types /etc/
# Disable the path warn as we set the correct path in the entrypoint when it is easy
# to know the users $HOME/.local/bin location. Changing path in the docker image does
# not work as we do not know where $HOME when using an ENV command.
RUN pip3 install --no-warn-script-location -r /baserow/requirements/base.txt -r /baserow/requirements/dev.txt
COPY --chown=$UID:$GID ./docs /baserow/docs
COPY --chown=$UID:$GID ./backend /baserow/backend
COPY --chown=$UID:$GID ./premium/backend /baserow/premium/backend
WORKDIR /baserow/backend
# Ensure that Python outputs everything that's printed inside
# the application rather than buffering it.
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH $PYTHONPATH:/baserow/backend/src:/baserow/premium/backend/src
ENV DJANGO_SETTINGS_MODULE='baserow.config.settings.dev'
RUN dos2unix /baserow/backend/docker/docker-entrypoint.sh && \
chmod a+x /baserow/backend/docker/docker-entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "--", "/bin/bash", "/baserow/backend/docker/docker-entrypoint.sh"]
CMD ["dev"]