forked from mosip/mosip-token-seeder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (34 loc) · 1.52 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
FROM python:3.8.13-slim-bullseye
RUN apt-get update
RUN apt-get -y install build-essential libsqlcipher-dev libsqlite3-dev autoconf libtool curl
RUN apt-get -y install procps
ADD ./mosip_token_seeder/requirements.txt /seeder/mosip_token_seeder/requirements.txt
RUN pip3 install -r /seeder/mosip_token_seeder/requirements.txt
RUN apt-get -y purge build-essential autoconf libtool
RUN apt-get -y autoremove
ARG container_user=mosip
ARG container_user_group=mosip
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}
RUN chown -R ${container_user}:${container_user_group} /seeder
USER ${container_user}
ADD --chown=${container_user}:${container_user_group} . /seeder
WORKDIR /seeder
ENV TOKENSEEDER_ROOT__PID_GREP_NAME='gunicorn'
ENV TOKENSEEDER_GUNICORN__WORKERS=4
ENV TOKENSEEDER_GUNICORN__MAX_REQUESTS=10000
ENV TOKENSEEDER_GUNICORN__TIMEOUT=1200
ENV TOKENSEEDER_GUNICORN__KEEP_ALIVE=1200
ENV TOKENSEEDER_DB__PRINT_PASSWORD_ON_STARTUP='false'
CMD TOKENSEEDER_DB__PASSWORD=$(python3 -m mosip_token_seeder.repository dbinit) gunicorn \
--worker-class uvicorn.workers.UvicornWorker \
--workers ${TOKENSEEDER_GUNICORN__WORKERS} \
--bind 0.0.0.0:8080 \
--max-requests ${TOKENSEEDER_GUNICORN__MAX_REQUESTS} \
--timeout ${TOKENSEEDER_GUNICORN__TIMEOUT} \
--keep-alive ${TOKENSEEDER_GUNICORN__KEEP_ALIVE} \
--access-logfile "-" \
--error-logfile "-" \
app:app