forked from resource-hub-dev/rhub-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (24 loc) · 951 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
31
32
33
34
FROM registry.access.redhat.com/ubi8/python-39
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
USER 0
RUN dnf install openssh-clients; \
dnf clean all
COPY . rhub_api
# https://docs.openshift.com/container-platform/4.11/openshift_images/create-images.html#images-create-guide-openshift_create-images
RUN ln -rsf rhub_api/bin bin && \
chown -R 1001:0 . && chmod -R g=u,o-wX .
# "default" user in the ubi container
USER 1001
WORKDIR /opt/app-root/src/rhub_api/
# TODO: improve performance
RUN pip install -r requirements.txt -e .
RUN export RHUB_DB_TYPE='postgresql'; \
export FLASK_ENV='development'; \
export FLASK_APP='rhub.api:create_app()'; \
export RHUB_RETURN_INITIAL_FLASK_APP=True; \
export RHUB_CONFIG=config/rhub.default.toml; \
python3 -m flask routes;
ENTRYPOINT ["./bin/entrypoint.sh"]
CMD ["rhub-api"]
HEALTHCHECK --interval=10s --retries=5 --timeout=5s CMD ["./bin/healthcheck.sh", "rhub-api"]