| |
@@ -0,0 +1,57 @@
|
| |
+ FROM fedora:latest
|
| |
+
|
| |
+ ENV ENV production
|
| |
+ ENV DATADIR /opt/elections/data
|
| |
+ ENV SERVERNAME fedora-elections
|
| |
+
|
| |
+ RUN dnf -y update && \
|
| |
+ dnf -y install gettext\
|
| |
+ httpd \
|
| |
+ libxslt \
|
| |
+ mod_wsgi \
|
| |
+ python \
|
| |
+ python-arrow \
|
| |
+ python-chardet \
|
| |
+ python-fasjson-client \
|
| |
+ python-fedora \
|
| |
+ python-fedora-flask \
|
| |
+ python-fedora-messaging \
|
| |
+ python-flask \
|
| |
+ python-flask-oidc \
|
| |
+ python-flask-sqlalchemy \
|
| |
+ python-flask-wtf \
|
| |
+ python-jinja2 \
|
| |
+ python-kitchen \
|
| |
+ python-lxml \
|
| |
+ python-openid \
|
| |
+ python-setuptools \
|
| |
+ python-simplejson \
|
| |
+ python-six \
|
| |
+ python-sqlalchemy \
|
| |
+ python-urllib3 \
|
| |
+ python-wtforms && \
|
| |
+ mkdir /etc/fedora-elections && \
|
| |
+ mkdir -p /opt/elections/data/fedora_elections && \
|
| |
+ pip install fedora_elections_messages
|
| |
+
|
| |
+ COPY files/fedora-elections.conf /etc/httpd/conf.d/fedora-elections.conf.sample
|
| |
+
|
| |
+ # Replace env vars in apache config
|
| |
+ RUN cat /etc/httpd/conf.d/fedora-elections.conf.sample | \
|
| |
+ envsubst > /etc/httpd/conf.d/fedora-elections.conf
|
| |
+
|
| |
+ COPY files/fedora-elections.wsgi ${DATADIR}/fedora_elections
|
| |
+ COPY files/fedora-elections.cfg /etc/fedora-elections
|
| |
+ COPY fedora_elections/static ${DATADIR}/static
|
| |
+
|
| |
+ WORKDIR /opt/elections
|
| |
+
|
| |
+ COPY docker-entrypoint.sh /usr/local/bin/
|
| |
+ COPY . .
|
| |
+
|
| |
+ RUN pip install .
|
| |
+
|
| |
+ EXPOSE 80
|
| |
+
|
| |
+ ENTRYPOINT [ "docker-entrypoint.sh" ]
|
| |
+ CMD [ "httpd", "-D", "FOREGROUND" ]
|
| |
While starting on the work to bring in a
Jenkinsfile
for https://pagure.io/elections/issue/93, I noticed there isn't a production readyDockerfile
. This could be helpful if down the line this app gets deployed as a container.As such, I have started to bring in a proof of concept of a production
Dockerfile
, developmentdev.Dockerfile
, anddocker-compose.development.yaml
in this PR.Feel free to decline if this is not needed.
Caveats:
envsubst
is probably suboptimal, other suggestions would be greatQuestions:
createdb.py
idempotent?