Commit ccac8be2 authored by carlosribas's avatar carlosribas
Browse files

Change the path to the static files

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