From dba6255ee222c63c0a0e4d68030a1e56f89e8dc4 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Mon, 3 Jun 2024 16:50:53 +0200 Subject: [PATCH] Make a start with https://github.com/tosdr/edit.tosdr.org/issues/1158 --- README.md | 2 +- staging-deploy.sh => staging/deploy.sh | 27 ++++++++++++++------ staging/nginxproxymanager/docker-compose.yml | 12 +++++++++ 3 files changed, 32 insertions(+), 9 deletions(-) rename staging-deploy.sh => staging/deploy.sh (88%) create mode 100644 staging/nginxproxymanager/docker-compose.yml diff --git a/README.md b/README.md index d28d3b87..79e25f11 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Phoenix, when used, also connects to two other services: Atlassian, which runs [ To deploy this code to https://do-staging.tosdr.org: * get an Ubuntu 24.04 server * ssh into it as root -* download the `staging-deploy.sh` script from this repo, and run it +* download the `./staging/deploy.sh` script from this repo, and run it ## Development diff --git a/staging-deploy.sh b/staging/deploy.sh similarity index 88% rename from staging-deploy.sh rename to staging/deploy.sh index e24f38fe..1f4b9c2f 100644 --- a/staging-deploy.sh +++ b/staging/deploy.sh @@ -13,7 +13,25 @@ sudo apt-get install -yq docker-ce docker-ce-cli containerd.io docker-buildx-plu sudo service docker start sudo docker run hello-world -# edit.tosdr.org +# pyenv +apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev +curl https://pyenv.run | bash +echo -e 'export PYENV_ROOT="$HOME/.pyenv"\nexport PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc +echo -e 'eval "$(pyenv init --path)"\neval "$(pyenv init -)"' >> ~/.bashrc +source ~/.bashrc + +# Node.js +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash +source ~/.bashrc +nvm install 20 +nvm use 20 +corepack enable +yarn --version -q + +# Postgres +apt install -q libpq-dev + +# Phoenix git clone https://github.com/tosdr/edit.tosdr.org.git cd edit.tosdr.org docker compose build @@ -24,13 +42,6 @@ docker exec -it edittosdrorg-web-1 rails db:seed docker compose down cd .. -# pyenv -apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev -curl https://pyenv.run | bash -echo -e 'export PYENV_ROOT="$HOME/.pyenv"\nexport PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc -echo -e 'eval "$(pyenv init --path)"\neval "$(pyenv init -)"' >> ~/.bashrc -source ~/.bashrc - # Hypothesis git clone https://github.com/tosdr/h cd h diff --git a/staging/nginxproxymanager/docker-compose.yml b/staging/nginxproxymanager/docker-compose.yml new file mode 100644 index 00000000..a7b4bbd6 --- /dev/null +++ b/staging/nginxproxymanager/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.8' +services: + app: + image: 'jc21/nginx-proxy-manager:latest' + restart: unless-stopped + ports: + - '80:80' + - '81:81' + - '443:443' + volumes: + - ./data:/data + - ./letsencrypt:/etc/letsencrypt \ No newline at end of file