Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker-compose for simpler install #97

Merged
merged 14 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,20 @@ LCG: https://de1-gateway.shocklink.net

## Using Docker

See [docker-compose.yml](docker-compose.yml).
Clone the repo

Edit the enviroment files in the env folder

Change the postgres data storage location in docker-compose.yml from `/path/to/postgres-data` to the location you want

Run with `docker compose [-p openshock] up -d`

the service needs https to work, setup a reverse proxy

- webui/frontend/share domain -> 5002
- api -> 5001
- lcg -> 5003


## Support

Expand Down
41 changes: 14 additions & 27 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is a minimal example of a runnable ShockLink stack.
# This file is a minimal plug and play working example of a runnable ShockLink stack.

version: '3.9'

Expand All @@ -10,8 +10,9 @@ services:
container_name: openshock-pg
networks:
- openshock
environment:
- POSTGRES_PASSWORD=postgres
env_file: "env/postgres.env"
volumes:
- /path/to/postgres-data:/var/lib/postgresql/data

redis:
restart: unless-stopped
Expand All @@ -29,48 +30,34 @@ services:
- redis
ports:
- "5001:80/tcp"
environment:
OPENSHOCK__DB__CONN: Host=docker-node;Port=1337;Database=openshock;Username=root;Password=root
OPENSHOCK__REDIS__HOST: redis
OPENSHOCK__FRONTEND__BASEURL: https://shocklink.net
OPENSHOCK__FRONTEND__SHORTURL: https://shockl.ink
OPENSHOCK__FRONTEND__COOKIEDOMAIN: shocklink.net
OPENSHOCK__MAIL__TYPE: MAILJET # MAILJET or SMTP, check Documentation
OPENSHOCK__MAIL__MAILJET__KEY: mailjetkey
OPENSHOCK__MAIL__MAILJET__SECRET: mailjetsecret
OPENSHOCK__MAIL__MAILJET__TEMPLATE__PASSWORDRESET: 9999999
env_file:
- "env/global.env"
- "env/api.env"

webui:
image: ghcr.io/openshock/webui:latest
restart: unless-stopped
ports:
- "5002:80/tcp"
environment:
- OPENSHOCK_NAME=ShockLink
- OPENSHOCK_URL=https://shocklink.net
- OPENSHOCK_SHARE_URL=https://shockl.ink
- OPENSHOCK_API_URL=https://api.shocklink.net
env_file: "env/webui.env"

lcg:
image: ghcr.io/openshock/live-control-gateway:latest
restart: unless-stopped
ports:
- "5003:80/tcp"
networks:
- openshock
environment:
OPENSHOCK__DB__CONN=Host: db;Port=5432;Database=shocklink;Username=shocklink;Password=someSuperSecurePassword
OPENSHOCK__REDIS__HOST: redis
OPENSHOCK__LCG__COUNTRYCODE: DE
OPENSHOCK__LCG__FQDN: de1-gateway.shocklink.net
env_file:
- "env/global.env"
- "env/lcg.env"

cron:
image: ghcr.io/openshock/cron:master
restart: unless-stopped
networks:
- openshock
environment:
OPENSHOCK__DB__CONN=Host: db;Port=5432;Database=shocklink;Username=shocklink;Password=someSuperSecurePassword
OPENSHOCK__REDIS__HOST: redis

env_file: "env/global.env"

networks:
openshock:
26 changes: 26 additions & 0 deletions env/api.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

#set web domain info
OPENSHOCK__FRONTEND__BASEURL: https://[sub].domain.tld # primary domain
OPENSHOCK__FRONTEND__SHORTURL: https://[sub].dom.ain # share/secondary domain, can be the same as primary
OPENSHOCK__FRONTEND__COOKIEDOMAIN: domain.tld # cookie domain, must be the domain without any subdomains, even if the base url has a subdomain

#global email config
OPENSHOCK__TURNSTILE__ENABLE=true
OPENSHOCK__MAIL__SENDER__NAME=shock name
OPENSHOCK__MAIL__SENDER__EMAIL=open@shock.zap

#mail configs. uncomment one of the 2 sections below and make your config changes

#MailJet
#OPENSHOCK__MAIL__TYPE: MAILJET # MAILJET or SMTP, check Documentation
#OPENSHOCK__MAIL__MAILJET__KEY: mailjetkey
#OPENSHOCK__MAIL__MAILJET__SECRET: mailjetsecret
#OPENSHOCK__MAIL__MAILJET__TEMPLATE__PASSWORDRESET: 9999999

#SMTP
#OPENSHOCK__MAIL__TYPE=SMTP # MAILJET or SMTP, check Documentation
#OPENSHOCK__MAIL__SMTP__HOST=mail.domain.zap
#OPENSHOCK__MAIL__SMTP__USERNAME=open@shock.zap
#OPENSHOCK__MAIL__SMTP__PASSWORD=SMTPPASSWORD
#OPENSHOCK__MAIL__SMTP__ENABLESSL=true
#OPENSHOCK__MAIL__SMTP__VERIFYCERTIFICATE=true
5 changes: 5 additions & 0 deletions env/global.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#change the Username and Password to the values set in the postgres enviroment
OPENSHOCK__DB__CONN=Host=db;Port=5432;Database=shocklink;Username=shocklink;Password=someSuperSecurePassword

#uses the name of the image for redis in the docker compose file, only change if you edited the compose file
OPENSHOCK__REDIS__HOST: redis
2 changes: 2 additions & 0 deletions env/lcg.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OPENSHOCK__LCG__COUNTRYCODE: CC # contry code of live control gateway, EX US,DE,UK
OPENSHOCK__LCG__FQDN: [lcg].domain.tld # live control gateway domain, make it diffrent from your api domain
3 changes: 3 additions & 0 deletions env/postgres.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#set the root password and username for postgres, make sure to update global.env to match the credentals set here
POSTGRES_PASSWORD=someSuperSecurePassword
POSTGRES_USER=shocklink
5 changes: 5 additions & 0 deletions env/webui.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#set the web interface urls and how the front end accesses the api backend
OPENSHOCK_NAME=OpenShock # the name that shows in the tab of your browser
OPENSHOCK_URL=https://[sub].domain.tld #domain for the webui
OPENSHOCK_SHARE_URL=https://[sub].domain.tld # if you have a shorter domain you can put something diffrent here, otherwise copy from above
OPENSHOCK_API_URL=https://[api].domain.tld # point to the domain that the api container connects to, will most likely be a sub domain