| |
@@ -1,4 +1,14 @@
|
| |
- FROM fedora:32
|
| |
+ FROM fedora:32 AS builder
|
| |
+ USER root
|
| |
+
|
| |
+ RUN dnf -y install rpm-build pyp2rpm make git redhat-lsb-core
|
| |
+
|
| |
+ COPY . /opt/app-root/src/oraculum/
|
| |
+
|
| |
+ RUN cd /opt/app-root/src/oraculum/ && make clean && make dockerdeps
|
| |
+
|
| |
+
|
| |
+ FROM fedora:32 AS deployment
|
| |
LABEL \
|
| |
name="Oraculum" \
|
| |
vendor="Fedora QE" \
|
| |
@@ -9,27 +19,15 @@
|
| |
|
| |
USER root
|
| |
|
| |
- RUN dnf -y install findutils rpm-build python3-pip python3-mod_wsgi python3-pycurl \
|
| |
- && dnf -y install python3-alembic \
|
| |
- python3-flask \
|
| |
- python3-flask-caching \
|
| |
- python3-flask-cors \
|
| |
- python3-flask-login \
|
| |
- python3-flask-oidc \
|
| |
- python3-flask-sqlalchemy \
|
| |
- python3-icalendar \
|
| |
- python3-lxml \
|
| |
- python3-mod_wsgi \
|
| |
- python3-pygments \
|
| |
- python3-bugzilla \
|
| |
- python3-dateutil \
|
| |
- python3-bodhi-client \
|
| |
- python3-pytz \
|
| |
- python3-psycopg2 \
|
| |
- python3-requests \
|
| |
- python3-setuptools
|
| |
+ RUN dnf -y install findutils python3-pip python3-setuptools python3-psycopg2 python3-mod_wsgi
|
| |
+
|
| |
+ # install dependencies extracted from setup.py and specfile
|
| |
+ COPY --from=builder /opt/app-root/src/oraculum/build/Dockerbuild/install_requires.list /opt/app-root/src/oraculum/
|
| |
+ RUN cat /opt/app-root/src/oraculum/install_requires.list | xargs -d '\n' dnf -y install && dnf clean all
|
| |
+
|
| |
+ # copy sources to the container
|
| |
+ COPY --from=builder /opt/app-root/src/oraculum/build/Dockerbuild/src/ /opt/app-root/src/oraculum/
|
| |
|
| |
- COPY . /opt/app-root/src/oraculum/
|
| |
# install using --no-deps option to ensure nothing comes from PyPi
|
| |
RUN pip3 install --no-deps /opt/app-root/src/oraculum/
|
| |
|
| |
@@ -51,17 +49,13 @@
|
| |
RUN cp -a /opt/app-root/src/oraculum/alembic /usr/share/oraculum/alembic
|
| |
RUN chmod -R 0755 /usr/share/oraculum/alembic
|
| |
|
| |
- # clean up
|
| |
- RUN rm -rf /opt/app-root/src/oraculum \
|
| |
- && dnf -y autoremove findutils rpm-build \
|
| |
- && dnf clean all
|
| |
-
|
| |
# EXPOSE 5005/tcp
|
| |
EXPOSE 5005
|
| |
|
| |
#RUN echo "SECRET_KEY = '`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1`'" >> /etc/oraculum/settings.py
|
| |
#RUN echo "SQLALCHEMY_DATABASE_URI = 'sqlite:////var/tmp/oraculum.sqlite'" >> /etc/oraculum/settings.py
|
| |
- RUN echo "OIDC_CLIENT_SECRETS = '/etc/oraculum/client_secrets.json'" >> /etc/oraculum/settings.py
|
| |
+ #RUN install -p -m 0644 /opt/app-root/src/oraculum/conf/client_secrets.json.example /etc/oraculum/client_secrets.json
|
| |
+ #RUN echo "OIDC_CLIENT_SECRETS = '/etc/oraculum/client_secrets.json'" >> /etc/oraculum/settings.py
|
| |
|
| |
CMD [ "runserver" ]
|
| |
ENTRYPOINT [ "/usr/bin/container_start" ]
|
| |
.. commit works outside the docker env
... commit contains changes to make it work in docker build... god knows why is this needed
This is terrible, it should be burned and I wish not to see it ever again!