fas: separate static from non-static

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
Patrick Uiterwijk 2019-05-11 00:28:39 +02:00
parent 02320458d1
commit f35c7220f5
3 changed files with 37 additions and 13 deletions

View file

@ -33,13 +33,15 @@ data:
{% endif %}
.stg.fedoraproject.org = STG.FEDORAPROJECT.ORG
stg.fedoraproject.org = STG.FEDORAPROJECT.ORG
start.sh: |-
static_start.sh: |-
set -xe
rm -rf /httpdir/*
mkdir /httpdir/run
ln -s /etc/httpd/modules /httpdir/modules
truncate --size=0 /httpdir/accesslog /httpdir/errorlog
tail -qf /httpdir/accesslog /httpdir/errorlog &
exec /usr/sbin/httpd.worker -f /etc/fas/httpd.conf -DFOREGROUND -DNO_DETACH
httpd.conf: |-
static_httpd.conf: |-
Listen 0.0.0.0:8080
ServerRoot "/httpdir"
PidFile "/httpdir/httpd.pid"
@ -54,13 +56,9 @@ data:
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule mime_module modules/mod_mime.so
LoadModule status_module modules/mod_status.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule version_module modules/mod_version.so
LoadModule wsgi_module modules/mod_wsgi.so
StartServers 4
MaxClients 300
MinSpareThreads 25
@ -75,8 +73,13 @@ data:
AddDefaultCharset UTF-8
CoreDumpDirectory /tmp
# FAS stuff
{{ load_file('fas-app.conf.j2') | indent() }}
Alias /accounts/static /usr/share/fas/static
<Directory /usr/share/fas/static>
Order deny,allow
Allow from all
</Directory>
app_start.sh: |-
set -xe
fas_sync_cert.pem: |-
{{ lookup('file', '{{ roles_path }}/fas_server/files/ipa.{{env}}.pem') | indent() }}
fas-log.cfg: |-

View file

@ -25,7 +25,7 @@ spec:
python-requests-kerberos \
krb5-workstation \
httpd \
mod_wsgi
python-gunicorn
# Set up config symlinks
RUN rm -f /etc/krb5.conf && \
@ -37,7 +37,7 @@ spec:
ln -sf /etc/fas/fas-log.cfg /usr/lib/python2.6/site-packages/fas/config/log.cfg
EXPOSE 8080
ENTRYPOINT bash /etc/fas/start.sh
ENTRYPOINT bash
type: Dockerfile
strategy:
type: Docker

View file

@ -31,8 +31,10 @@ spec:
containers:
- name: fas
image: fas:latest
command:
- /etc/fas/app_start.sh
ports:
- containerPort: 8080
- containerPort: 8000
volumeMounts:
- name: config-volume
mountPath: /etc/fas
@ -43,19 +45,38 @@ spec:
- name: secret-pubring
mountPath: /etc/fas-gpg/pubring.gpg
readOnly: true
readinessProbe:
timeoutSeconds: 5
initialDelaySeconds: 1
httpGet:
path: /accounts/
port: 8000
livenessProbe:
timeoutSeconds: 5
initialDelaySeconds: 1
httpGet:
path: /accounts/
port: 8000
- name: static
image: fas:latest
command:
- /etc/fas/static_start.sh
ports:
- containerPort: 8080
volumeMounts:
- name: httpdir-volume
mountPath: /httpdir
readinessProbe:
timeoutSeconds: 5
initialDelaySeconds: 1
httpGet:
path: /
path: /accounts/static/robots.txt
port: 8080
livenessProbe:
timeoutSeconds: 5
initialDelaySeconds: 1
httpGet:
path: /
path: /accounts/static/robots.txt
port: 8080
volumes:
- name: config-volume