Commit 91d6974c authored by Conor Anderson's avatar Conor Anderson

More cleanup

parent d7cd6dba
events {
worker_connections 4096; ## Default: 1024
}
http {
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
server_name api.conr.ca;
location /conjuntool/ {
proxy_pass http://lbplumb:80/;
proxy_set_header Host $host;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80 default_server;
listen [::]:80 ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
server_name shiny.conr.ca;
location /conjuntool/ {
proxy_pass http://lbcjt:80/;
proxy_set_header Host $host;
}
location ~ /\.ht {
deny all;
}
}
}
......@@ -6,33 +6,19 @@ services:
build: ./shiny
restart: always
volumes:
- /home/conor/git/R/conjuntool/shiny/local_settings.R:/srv/shiny-server/app/local_settings.R:ro
- ./shiny/local_settings.R:/srv/shiny-server/app/local_settings.R:ro
- ./shiny/shiny-server.conf:/etc/shiny-server/shiny-server.conf:ro
cjtplumb:
plumber:
build: ./plumber
restart: always
volumes:
- /data/climate_data:/data/climate_data
- /home/conor/git/R/conjuntool/plumber/plumber_settings.R:/plumber_settings.R:ro
- ./plumber/plumber_settings.R:/plumber_settings.R:ro
lbplumb:
lb:
image: 'dockercloud/haproxy:1.2.1'
links:
- cjtplumb
- plumber:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
lbcjt:
image: 'dockercloud/haproxy:1.2.1'
links:
- conjuntool
volumes:
- /var/run/docker.sock:/var/run/docker.sock
nginx:
image: nginx:1.9
volumes:
- /home/conor/git/R/conjuntool/conf/nginx.conf:/etc/nginx/nginx.conf:ro
restart: always
depends_on:
- lb
FROM trestletech/plumber
MAINTAINER Conor Anderson <[email protected]>
COPY . /srv/shiny-server/app
COPY app/plumber.R /app/plumber.R
RUN apt-get update &&\
apt-get install -y --no-install-recommends curl libnetcdf-dev &&\
......
......@@ -13,17 +13,5 @@ RUN cd /srv/shiny-server/app &&\
for file in $(ls *.R); do sed -rn 's/library\((.*)\)/\1/p' $file; done | sort | uniq > needed_packages &&\
curl https://gitlab.com/ConorIA/conjuntool/snippets/1788463/raw?inline=false > install_pkgs.R &&\
Rscript install_pkgs.R &&\
Rscript -e "webshot::install_phantomjs()" &&\
sudo -u shiny bash -c "Rscript -e \"webshot::install_phantomjs()\"" &&\
rm -rf /tmp/* needed_packages install_pkgs.R
#Rscript -e 'install.packages("packrat", repos = "https://cloud.r-project.org")' &&\
#cd /srv/shiny-server/app &&\
#Rscript -e 'packrat::restore()' &&\
#rm -rf /tmp/*
#USER shiny
#RUN cd /srv/shiny-server/app &&\
# if [ ! -e $HOME/bin/phantomjs ]; then Rscript -e "webshot::install_phantomjs()"; fi
EXPOSE 80
# Define the user we should use when spawning R Shiny processes
run_as shiny;
# Define a top-level server which will listen on a port
server {
# Instruct this server to listen on port 80. The app at dokku-alt need expose PORT 80, or 500 e etc. See the docs
listen 80;
listen 3838;
# Define the location available at the base URL
location / {
# Run this location in 'site_dir' mode, which hosts the entire directory
# tree at '/srv/shiny-server'
site_dir /srv/shiny-server/app;
# Define where we should put the log files for this location
location /conjuntool/ {
site_dir /srv/shiny-server/app/;
log_dir /var/log/shiny-server;
# Should we list the contents of a (non-Shiny-App) directory when the user
# visits the corresponding URL?
directory_index off;
}
}
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