-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.Dockerfile
33 lines (24 loc) · 1.11 KB
/
dev.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.11.01
SHELL ["/bin/bash", "-c"]
# Run as root in the Dockerfile until we drop down to the service user in the entrypoint
USER root
WORKDIR /notification
# Create data directory
RUN mkdir -p /notification/data
COPY pyproject.toml .
COPY poetry.lock .
COPY entrypoint.bash .
COPY run.dev.bash .
# Install production + development dependencies
# Without --no-root, we get errors related to the code not being copied in yet.
# But we don't want the code here, otherwise Docker cache doesn't work well.
RUN poetry config virtualenvs.create false && \
poetry install --no-root
# Tell the service that we're running a local development container
ENV BENTO_CONTAINER_LOCAL=true
# Don't include actual code in the development image - will be mounted in using a volume.
# Run
# - Must be ENTRYPOINT and not CMD since this needs root to fix permissions, after which it drops down via gosu
# - CMD passes script to run after fixing up permissions with root and dropping down into the service user
ENTRYPOINT [ "bash", "./entrypoint.bash" ]
CMD [ "bash", "./run.dev.bash" ]