Commit ccac8be2 authored by carlosribas's avatar carlosribas
Browse files

Change the path to the static files

parent 26712698
......@@ -25,7 +25,7 @@ RUN \
mkdir -p $RNACENTRAL_LOCAL && \
mkdir -p $SUPERVISOR_CONF_DIR && \
mkdir /srv/rnacentral/log && \
mkdir /srv/static
mkdir /srv/rnacentral/static
# Install Infernal and node.js
RUN \
......@@ -62,7 +62,7 @@ ADD rnacentral/portal/static/package.json rnacentral/portal/static/
RUN cd rnacentral/portal/static && npm install --only=production
# Copy and chown all the files to the rnacentral user
COPY rnacentral/ $RNACENTRAL_HOME/
COPY rnacentral $RNACENTRAL_HOME/rnacentral
RUN chown -R rnacentral:rnacentral /srv
# Install and configure packages for local development if needed
......
......@@ -22,7 +22,7 @@ services:
expose:
- 8000
volumes:
- static_volume:/srv/static
- static_volume:/srv/rnacentral/static
- ./openssl/openssl.cnf:/etc/ssl/openssl.cnf
depends_on:
- redis
......@@ -48,7 +48,7 @@ services:
- 8000:80
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- static_volume:/srv/static
- static_volume:/srv/rnacentral/static
depends_on:
- rnacentral
networks:
......
......@@ -26,12 +26,12 @@ SUPERVISOR_CONF_DIR=${SUPERVISOR_CONF_DIR:-"/srv/rnacentral/supervisor"}
LOGS=/srv/rnacentral/log
# Add local_settings file
if [ -f "${RNACENTRAL_HOME}"/rnacentral/local_settings.py ]
if [ -f "${RNACENTRAL_HOME}"/rnacentral/rnacentral/local_settings.py ]
then
echo "INFO: RNAcentral local_settings.py file already provisioned"
else
echo "INFO: Creating RNAcentral local_settings.py file"
cat <<-EOF > "${RNACENTRAL_HOME}"/rnacentral/local_settings.py
cat <<-EOF > "${RNACENTRAL_HOME}"/rnacentral/rnacentral/local_settings.py
import os
from .utils import get_environment
SECRET_KEY = "$SECRET_KEY"
......@@ -75,8 +75,8 @@ else
}
}
EOF
sed -i "3 a DEBUG = ${DJANGO_DEBUG}" "${RNACENTRAL_HOME}"/rnacentral/local_settings.py
chown -R rnacentral "${RNACENTRAL_HOME}"/rnacentral/local_settings.py
sed -i "3 a DEBUG = ${DJANGO_DEBUG}" "${RNACENTRAL_HOME}"/rnacentral/rnacentral/local_settings.py
chown -R rnacentral "${RNACENTRAL_HOME}"/rnacentral/rnacentral/local_settings.py
fi
# Supervisor setup
......@@ -96,8 +96,8 @@ else
nodaemon=true
[program:rqworkers]
command=python $RNACENTRAL_HOME/manage.py rqworker
directory=$RNACENTRAL_HOME
command=python $RNACENTRAL_HOME/rnacentral/manage.py rqworker
directory=$RNACENTRAL_HOME/rnacentral
numprocs=1
process_name=%(program_name)s_%(process_num)s
autorestart=true
......@@ -106,7 +106,7 @@ else
stdout_logfile=${LOGS}/rqworkers.out.log
[program:rnacentral]
command=gunicorn --chdir $RNACENTRAL_HOME --bind 0.0.0.0:8000 rnacentral.wsgi:application
command=gunicorn --chdir $RNACENTRAL_HOME/rnacentral --bind 0.0.0.0:8000 rnacentral.wsgi:application
user=rnacentral
autostart=true
autorestart=true
......@@ -119,6 +119,6 @@ fi
# Run collectstatic
echo "INFO: Copying the static files"
python "${RNACENTRAL_HOME}"/manage.py collectstatic --noinput
python "${RNACENTRAL_HOME}"/rnacentral/manage.py collectstatic --noinput
exec "$@"
\ No newline at end of file
......@@ -28,7 +28,7 @@ data:
location /static/ {
autoindex on;
alias /srv/static/;
alias /srv/rnacentral/static/;
}
location / {
......@@ -73,7 +73,7 @@ spec:
mountPath: /etc/nginx/conf.d/local.conf
subPath: local.conf
- name: static-volume
mountPath: /srv/static
mountPath: /srv/rnacentral/static
restartPolicy: Always
volumes:
- name: nginx-config
......
......@@ -422,7 +422,7 @@ spec:
mountPath: /etc/ssl/openssl.cnf
subPath: openssl.cnf
- name: static-volume
mountPath: /srv/static
mountPath: /srv/rnacentral/static
envFrom:
- secretRef:
name: {{ .Values.database }}
......
......@@ -16,6 +16,6 @@ server {
location /static/ {
autoindex on;
alias /srv/static/;
alias /srv/rnacentral/static/;
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment