Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOSIP-31575] Updated docker file. #33

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
38 changes: 26 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
FROM python:3.8.13-slim-bullseye

abhishek8shankar marked this conversation as resolved.
Show resolved Hide resolved
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 SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

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}
ADD ./mosip_token_seeder/requirements.txt /seeder/mosip_token_seeder/requirements.txt

RUN apt-get update \
&& apt-get -y install build-essential libsqlcipher-dev libsqlite3-dev autoconf libtool curl \
&& apt-get -y install procps

ADD ./mosip_token_seeder/requirements.txt /seeder/mosip_token_seeder/requirements.txt

RUN chown -R ${container_user}:${container_user_group} /seeder
RUN pip3 install -r /seeder/mosip_token_seeder/requirements.txt \
&& apt-get -y purge build-essential autoconf libtool \
&& apt-get -y autoremove \
&& groupadd -g ${container_user_gid} ${container_user_group} \
&& useradd -mN -u ${container_user_uid} -G ${container_user_group} -s /bin/bash ${container_user} \
&& chown -R ${container_user}:${container_user_group} /seeder \
&& chown -R ${container_user}:${container_user} /home/${container_user}

USER ${container_user}
ADD --chown=${container_user}:${container_user_group} . /seeder
WORKDIR /seeder
ENV work_dir=/seeder
WORKDIR /home/${container_user}
USER ${container_user_uid}:${container_user_gid}

ENV TOKENSEEDER_ROOT__PID_GREP_NAME='gunicorn'
ENV TOKENSEEDER_GUNICORN__WORKERS=4
Expand All @@ -38,4 +52,4 @@ CMD TOKENSEEDER_DB__PASSWORD=$(python3 -m mosip_token_seeder.repository dbinit)
--keep-alive ${TOKENSEEDER_GUNICORN__KEEP_ALIVE} \
--access-logfile "-" \
--error-logfile "-" \
app:app
app:app
10 changes: 9 additions & 1 deletion test/utils/callback-tester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-2022-11-11

ARG container_user=mosip
ARG container_user_group=mosip
ARG container_user_uid=1001
ARG container_user_gid=1001
WORKDIR /home/${container_user}
RUN chown -R ${container_user}:${container_user} /home/${container_user}
USER ${container_user_uid}:${container_user_gid}

RUN pip3 install \
pyjwt==2.6.0 \
python-multipart==0.0.5 \
cryptography==38.0.3
cryptography==38.0.3