forked from bento-platform/katsu
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
42 lines (28 loc) · 1.06 KB
/
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
34
35
36
37
38
39
40
41
42
ARG venv_python=3.12
FROM python:${venv_python}
LABEL Maintainer="CanDIG Team"
LABEL "candigv2"="chord_metadata_service"
USER root
RUN groupadd -r candig && useradd -r -g candig candig
RUN apt-get update && apt-get -y install \
postgresql-client
RUN mkdir -p /home/candig && chown -R candig:candig /home/candig
RUN mkdir /app
WORKDIR /app
COPY ./requirements /app/requirements
# Conditionally install dependencies based on the environment
ARG debug_mode
RUN if [ ${debug_mode} = 1 ]; then \
pip install --no-cache-dir -r requirements/dev.txt; \
else \
pip install --no-cache-dir -r requirements/prod.txt; \
fi
COPY . /app/chord_metadata_service
WORKDIR /app/chord_metadata_service
# Create log and staticfiles directory and adjust permissions
RUN mkdir -p /app/chord_metadata_service/logs /app/chord_metadata_service/staticfiles \
&& chown -R candig:candig /app/chord_metadata_service
RUN chmod +x /app/chord_metadata_service/entrypoint.sh
RUN chmod +x /app/chord_metadata_service/create_db.sh
USER candig
CMD ["/app/chord_metadata_service/entrypoint.sh"]