Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Carlos Ribas
rnacentral-webcode
Commits
4a33d06f
Commit
4a33d06f
authored
Oct 22, 2020
by
carlosribas
Browse files
Use volume to serve static files
parent
86868400
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
docker/Dockerfile
docker/Dockerfile
+3
-4
docker/docker-compose.yml
docker/docker-compose.yml
+10
-4
nginx/conf.d/local.conf
nginx/conf.d/local.conf
+4
-2
No files found.
docker/Dockerfile
-development
→
docker/Dockerfile
View file @
4a33d06f
...
...
@@ -49,12 +49,11 @@ RUN \
git clone
-b
"
$BRANCH
"
https://github.com/RNAcentral/rnacentral-webcode.git
&&
\
pip
install
-r
$RNACENTRAL_HOME
/rnacentral-webcode/rnacentral/requirements.txt
&&
\
pip
install
gunicorn
&&
\
cd $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/portal/static && npm install --only=production
cd
$RNACENTRAL_HOME
/rnacentral-webcode/rnacentral/portal/static
&&
npm
install
--only
=
production
&&
\
mkdir
$RNACENTRAL_HOME
/static
WORKDIR
$RNACENTRAL_HOME/rnacentral-webcode
COPY
./entrypoint.sh /entrypoint.sh
ENTRYPOINT
[ "/entrypoint.sh" ]
# Expose a container port where the website is served
EXPOSE 8000
CMD
[ "/bin/sh", "-c", "/usr/bin/supervisord -c ${SUPERVISOR_CONF_DIR}/supervisord.conf" ]
docker/docker-compose.yml
View file @
4a33d06f
...
...
@@ -7,7 +7,6 @@ services:
context
:
.
args
:
-
RNACENTRAL_BRANCH=${RNACENTRAL_BRANCH}
dockerfile
:
Dockerfile-development
environment
:
-
DB_HOST=${DB_HOST}
-
DB_NAME=${DB_NAME}
...
...
@@ -15,6 +14,10 @@ services:
-
DB_PASSWORD=${DB_PASSWORD}
-
DB_PORT=${DB_PORT}
-
SECRET_KEY=${SECRET_KEY}
expose
:
-
8000
volumes
:
-
static_volume:/srv/rnacentral/static
depends_on
:
-
redis
networks
:
...
...
@@ -26,7 +29,7 @@ services:
redis
:
image
:
redis:6.0.8-alpine
ports
:
-
"
8051:8051
"
-
8051:8051
command
:
redis-server --port
8051
restart
:
always
networks
:
...
...
@@ -39,7 +42,7 @@ services:
-
8000:80
volumes
:
-
../nginx/conf.d:/etc/nginx/conf.d
-
../rnacentral/portal/static/:
/static
-
static_volume:/srv/rnacentral
/static
depends_on
:
-
rnacentral
networks
:
...
...
@@ -49,13 +52,16 @@ services:
memcached
:
image
:
memcached:1.6.7-alpine
ports
:
-
"
8052:8052
"
-
8052:8052
command
:
memcached -m 512m -p
8052
depends_on
:
-
rnacentral
networks
:
-
memcached-network
volumes
:
static_volume
:
networks
:
redis-network
:
driver
:
bridge
...
...
nginx/conf.d/local.conf
View file @
4a33d06f
...
...
@@ -5,15 +5,17 @@ upstream rnacentral {
server
{
listen
80
;
server_name
localhost
;
location
/ {
# everything is passed to Gunicorn
proxy_pass
http
://
rnacentral
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Host
$
host
;
proxy_redirect
off
;
}
location
/
static
/ {
autoindex
on
;
alias
/
static
/;
alias
/
srv
/
rnacentral
/
static
/;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment