-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
30 lines (22 loc) · 1011 Bytes
/
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
FROM bitnami/python:3.10.13-debian-11-r24
ARG container_user=openg2p
ARG container_user_group=openg2p
ARG container_user_uid=1001
ARG container_user_gid=1001
RUN groupadd -g ${container_user_gid} ${container_user_group} \
&& useradd -mN -u ${container_user_uid} -G ${container_user_group} -s /bin/bash ${container_user}
WORKDIR /app
RUN install_packages libpq-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives
RUN chown -R ${container_user}:${container_user_group} /app
USER ${container_user}
ADD --chown=${container_user}:${container_user_group} . /app/src
ADD --chown=${container_user}:${container_user_group} main.py /app
RUN python3 -m venv venv \
&& . ./venv/bin/activate
RUN python3 -m pip install \
git+https://github.com/openg2p/openg2p-fastapi-common@develop\#subdirectory=openg2p-fastapi-common \
git+https://github.com/openg2p/openg2p-fastapi-common@develop\#subdirectory=openg2p-fastapi-auth \
./src
CMD python3 main.py migrate; \
python3 main.py run