Dockerfile
This commit is contained in:
parent
cd60ff43b6
commit
89aaaa53ed
2 changed files with 77 additions and 0 deletions
68
Dockerfile
Normal file
68
Dockerfile
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# This will produce an image to be used in Openshift
|
||||
# Build should be triggered from repo root like:
|
||||
# podman build -f Dockerfile --tag <IMAGE_TAG>
|
||||
# Don't forget to mount persistent volume for development
|
||||
# podman run --volume hostdir:/bbugs -ti -u 0 -p 5001:5001 <IMAGE_TAG>
|
||||
|
||||
# On OpenShift, edit Deployment Configs, add:
|
||||
# spec:
|
||||
# volumes:
|
||||
# - name: run-volume
|
||||
# emptyDir: {}
|
||||
# containers:
|
||||
# volumeMounts:
|
||||
# - name: run-volume
|
||||
# mountPath: /run
|
||||
|
||||
FROM fedora:latest
|
||||
LABEL \
|
||||
name="BlockerBugs application" \
|
||||
vendor="Fedora QE" \
|
||||
license="GPLv2+" \
|
||||
description="Web front end to the currently proposed blocker and freeze exception bugs for Fedora releases under development." \
|
||||
usage="" \
|
||||
build-date=""
|
||||
|
||||
USER root
|
||||
COPY ./blockerbugs.spec /opt/app-root/src/blockerbugs/blockerbugs.spec
|
||||
|
||||
# install dependencies defined in RPM spec file
|
||||
RUN dnf -y install findutils rpm-build python3-pip python3-mod_wsgi python3-pycurl \
|
||||
&& rpm --query --requires --specfile /opt/app-root/src/blockerbugs/blockerbugs.spec | xargs -d '\n' dnf -y install
|
||||
|
||||
COPY . /opt/app-root/src/blockerbugs/
|
||||
# install using --no-deps option to ensure nothing comes from PyPi
|
||||
RUN pip3 install --no-deps /opt/app-root/src/blockerbugs/
|
||||
|
||||
# fix apache config for container use
|
||||
RUN sed -i 's#^WSGISocketPrefix .*#WSGISocketPrefix /var/run/wsgi#' /opt/app-root/src/blockerbugs/conf/blockerbugs.conf
|
||||
|
||||
# install launch script
|
||||
RUN install -p -m 0755 /opt/app-root/src/blockerbugs/container_start.sh /usr/bin/container_start
|
||||
|
||||
# config files
|
||||
RUN install -d /usr/share/blockerbugs/conf \
|
||||
&& install -p -m 0644 /opt/app-root/src/blockerbugs/conf/blockerbugs.conf /usr/share/blockerbugs/conf/ \
|
||||
&& install -p -m 0644 /opt/app-root/src/blockerbugs/conf/blockerbugs.wsgi /usr/share/blockerbugs/ \
|
||||
&& install -d /etc/blockerbugs \
|
||||
&& install -p -m 0644 /opt/app-root/src/blockerbugs/conf/blockerbugs.conf /etc/httpd/conf.d/
|
||||
|
||||
# alembic
|
||||
RUN install -p -m 0644 /opt/app-root/src/blockerbugs/alembic.ini /usr/share/blockerbugs/alembic.ini
|
||||
RUN cp -a /opt/app-root/src/blockerbugs/alembic /usr/share/blockerbugs/alembic
|
||||
RUN chmod -R 0755 /usr/share/blockerbugs/alembic
|
||||
|
||||
# clean up
|
||||
RUN rm -rf /opt/app-root/src/blockerbugs \
|
||||
&& dnf -y autoremove findutils rpm-build \
|
||||
&& dnf clean all
|
||||
|
||||
# EXPOSE 5001/tcp
|
||||
EXPOSE 5001
|
||||
|
||||
# Persistent VOLUME
|
||||
VOLUME [ "/bbugs" ]
|
||||
|
||||
CMD [ "runserver" ]
|
||||
ENTRYPOINT [ "/usr/bin/container_start" ]
|
||||
USER 1001:0
|
||||
9
container_start.sh
Executable file
9
container_start.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/bash
|
||||
if [[ $1 == runserver ]]; then
|
||||
blockerbugs init_db
|
||||
mod_wsgi-express-3 start-server /usr/share/blockerbugs/blockerbugs.wsgi --user apache --group apache \
|
||||
--port 5001 --threads 5 --include-file /etc/httpd/conf.d/blockerbugs.conf --log-level info \
|
||||
--log-to-terminal --access-log --startup-log
|
||||
else
|
||||
blockerbugs "$@"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue