Skip to content

Commit

Permalink
Update demo httpd and add deployment docs
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens committed Jun 20, 2024
1 parent 3c493da commit f53fe33
Show file tree
Hide file tree
Showing 5 changed files with 476 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
- 3999:3999
volumes:
- uploaded-files-volume:/data/uploads
restart: unless-stopped

client:
build:
Expand All @@ -37,6 +38,7 @@ services:
- /home/ec2-user/deployment/config.json:/usr/local/apache2/htdocs/config.json
- /home/ec2-user/deployment/data/:/usr/local/apache2/htdocs/data/
- /home/ec2-user/deployment/demoData/:/usr/local/apache2/htdocs/demoData/
restart: unless-stopped

mongo-node-1:
image: mongo:7
Expand Down Expand Up @@ -73,6 +75,7 @@ services:
volumes:
- mongo-node-1_data:/data/db
- mongo-node-1_config:/data/configdb
restart: unless-stopped

mongo-node-2:
image: mongo:7
Expand All @@ -87,6 +90,7 @@ services:
volumes:
- mongo-node-2_data:/data/db
- mongo-node-2_config:/data/configdb
restart: unless-stopped

volumes:
mongo-node-1_config: null
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/deploy/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
#LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_express_module modules/mod_proxy_express.so
Expand Down Expand Up @@ -196,7 +196,7 @@ LoadModule dir_module modules/mod_dir.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule rewrite_module modules/mod_rewrite.so

<IfModule unixd_module>
#
Expand Down Expand Up @@ -238,7 +238,7 @@ ServerAdmin [email protected]
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost:8080
#ServerName www.example.com:80

#
# Deny access to the entirety of your server's filesystem. You must
Expand Down Expand Up @@ -549,11 +549,5 @@ SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

<VirtualHost *:80>
RewriteEngine on

RewriteCond %{DOCUMENT_ROOT}/$1 !-f
RewriteCond %{DOCUMENT_ROOT}/$1 !-d
RewriteRule ^/(.*)$ http://apollo-collaboration-server:3999/$1 [P,QSA]
ProxyPassReverse / http://apollo-collaboration-server:3999/
</VirtualHost>
ProxyPassMatch "^/apollo/(.*)$" "http://apollo-collaboration-server:3999/$1" upgrade=websocket connectiontimeout=3600 timeout=3600
ProxyPassReverse "/apollo/" "http://apollo-collaboration-server:3999/"
75 changes: 75 additions & 0 deletions docs/deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
FROM httpd:alpine
ARG JBROWSE_VERSION
ARG APOLLO_VERSION
ARG FORWARD_HOSTNAME
ARG FORWARD_PORT
ARG URL
COPY <<EOF /usr/local/apache2/conf/httpd.conf.append
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
ServerName localhost

ProxyPassMatch "^/apollo/(.*)$" "http://${FORWARD_HOSTNAME}:${FORWARD_PORT}/\$1" upgrade=websocket connectiontimeout=3600 timeout=3600
ProxyPassReverse "/apollo/" "http://${FORWARD_HOSTNAME}:${FORWARD_PORT}/"
EOF
COPY <<EOF /usr/local/apache2/htdocs/config.json
{
"configuration": {
"theme": {
"palette": {
"primary": {
"main": "#24264a"
},
"secondary": {
"main": "#6f8fa2"
},
"tertiary": {
"main": "#1e4b34"
},
"quaternary": {
"main": "#6b4e2b"
}
}
}
},
"plugins": [
{
"name": "Apollo",
"url": "/jbrowse-plugin-apollo.umd.production.min.js"
}
],
"internetAccounts": [
{
"type": "ApolloInternetAccount",
"internetAccountId": "apolloInternetAccount",
"name": "My Apollo Server",
"description": "A server for my annotations",
"domains": [
"${URL}"
],
"baseURL": "${URL}/apollo/"
}
],
"defaultSession": {
"name": "Apollo Demo",
"views": [
{
"type": "LinearGenomeView"
}
]
}
}
EOF
WORKDIR /usr/local/apache2/htdocs/
RUN <<EOF
set -o errexit
set -o nounset
set -o pipefail
cat /usr/local/apache2/conf/httpd.conf.append >> /usr/local/apache2/conf/httpd.conf
wget https://github.com/GMOD/jbrowse-components/releases/download/v$JBROWSE_VERSION/jbrowse-web-v$JBROWSE_VERSION.zip
unzip -o jbrowse-web-v$JBROWSE_VERSION.zip
rm jbrowse-web-v$JBROWSE_VERSION.zip
wget --output-document=- --quiet https://registry.npmjs.org/@apollo-annotation/jbrowse-plugin-apollo/-/jbrowse-plugin-apollo-$APOLLO_VERSION.tgz | \
tar --extract --gzip --file=- --strip=2 package/dist/jbrowse-plugin-apollo.umd.production.min.js
EOF
92 changes: 92 additions & 0 deletions docs/deployment/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: apollo-demo-site

services:
apollo-collaboration-server:
image: ghcr.io/gmod/apollo-collaboration-server
depends_on:
mongo-node-1:
condition: service_healthy
env_file: .env
environment:
MONGODB_URI: mongodb://mongo-node-1:27017,mongo-node-2:27018/apolloDb?replicaSet=rs0
FILE_UPLOAD_FOLDER: /data/uploads
ALLOW_GUEST_USER: true
GUEST_USER_ROLE: admin
URL: http://localhost
JWT_SECRET: change_this_value
SESSION_SECRET: change_this_value
ports:
- 3999:3999
volumes:
- uploaded-files-volume:/data/uploads

client:
build:
args:
APOLLO_VERSION: 0.1.16
JBROWSE_VERSION: 2.11.2
FORWARD_HOSTNAME: apollo-collaboration-server
FORWARD_PORT: 3999
URL: http://localhost
context: .
depends_on:
- apollo-collaboration-server
ports:
- '80:80'

mongo-node-1:
image: mongo:7
command:
- '--replSet'
- rs0
- '--bind_ip_all'
- '--port'
- '27017'
healthcheck:
interval: 30s
retries: 3
start_interval: 5s
start_period: 2m
test: |
mongosh --port 27017 --quiet --eval "
try {
rs.status()
console.log('replica set ok')
} catch {
rs.initiate({
_id: 'rs0',
members: [
{ _id: 0, host: 'mongo-node-1:27017', priority: 1 },
{ _id: 1, host: 'mongo-node-2:27018', priority: 0.5 },
],
})
console.log('replica set initiated')
}
"
timeout: 10s
ports:
- '27017:27017'
volumes:
- mongo-node-1_data:/data/db
- mongo-node-1_config:/data/configdb

mongo-node-2:
image: mongo:7
command:
- '--replSet'
- rs0
- '--bind_ip_all'
- '--port'
- '27018'
ports:
- '27018:27018'
volumes:
- mongo-node-2_data:/data/db
- mongo-node-2_config:/data/configdb

volumes:
mongo-node-1_config: null
mongo-node-1_data: null
mongo-node-2_config: null
mongo-node-2_data: null
uploaded-files-volume: null
Loading

0 comments on commit f53fe33

Please sign in to comment.