This repository contains the docker containers and docker-compose.yml
's required to launch my personal server. Applications hosted by this server can be found at apps.samabbott.co.uk, although the server is designed to serve users from samabbott.co.uk/#projects. It makes use of the following services,
Modification to another use case should be straightforward. Any suggestions for improvements are welcome.
The server can be launched using the following bash
commands (implemented in the set-up-server.sh
bash script) once the secrets folder has been setup as required.
- Clone this repository into a docker and docker-compose enabled environment.
git clone https://github.com/seabbs/personal-server.git
-
Add required secrets to the
secrets
folder. Subdirectories are named based on the container they provide secrets for. Required container secrets are listed incontainers/docker-compose.yml
-
Add docker network
docker network create shinyproxy-net
- Pull all images.
docker-compose -f containers/docker-compose.yml pull --ignore-pull-failures
- Build all images.
docker-compose -f containers/docker-compose.yml build
- Change permissions for Jenkins
sudo chown -R 1000:1000 secrets/jenkins
- Launch all services
docker-compose up -d
There should now be a shinyproxy instance at 8080
, a jenkins instance at 9090
, and an Rstudio instance at 8888
.
The Jenkins instance (found at localhost:9090
) is used to run scheduled docker containers. Currently these jobs are;
- Run the
h2o
StackOverflow Twitter bot every 15 minutes (H/15 * * * *
) with,
cd ../../..
sudo docker-compose -f personal-server/containers/docker-compose.yml run h2o_tweets bash bin/run_h2o_bot.sh
- Run the second summary
h2o
StackOverflow Twitter bot every month (H 0 01 * *
) with,
cd ../../..
sudo docker-compose -f personal-server/containers/docker-compose.yml run h2o_tweets bash bin/run_h2o_monthly_bot.sh
- Run the Rstudio Cheatsheet Twitter Bot once a day (
H 0 * * *
) with,
cd ../../..
sudo docker-compose -f personal-server/containers/docker-compose.yml run tweetrstudiocheatsheets Rscript bot.R
- Back up the server storage once a day (
H 1 * * *
) to a Google bucket with,
cd ../../..
sudo bash personal-server/push_to_bucket.sh
If properly configured the Shinyproxy instance can be found at apps.samabbott.co.uk, with the Rstudio instance at rstudio.samabbott.co.uk (password controlled via secrets
). In order to access the Jenkins server connect over ssh, forwarding 9090
. Similarly both the ShinyProxy instance and the Rstudio instance may also be accessed using port forwarding (8080
and 8888
respectively).
To update containers use docker-compose -f containers/docker-compose.yml pull <container-name>
to update built images and docker-compose -f containers/docker-compose.yml build <container-name>
to update container builds. Then bring down the running container using docker-compose down <container-name>
and relaunch it using docker-compose up <container-name>
. Alternatively a Watchtower container is monitoring the available images and every hour will refresh the running images with any newly available images. Before updating the Jenkins container be sure to back up the jenkins folder using bash push_to_bucket.sh
.
See the GitHub issues for planned bug fixes and enhancements. Any suggestions or bug reports are welcome.