From af0bc98775ddb101599f2d5a645f008d09af2673 Mon Sep 17 00:00:00 2001 From: peskyadmin Date: Mon, 21 Apr 2025 22:37:15 -0500 Subject: [PATCH] manual init --- README.md | 81 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 421f25e..7378da3 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,38 @@ -# {{Service}} with Tailscale Integration +# Cheminformatics with Tailscale Integration -![{{Service}} with Tailscale](https://damconsulting.llc/images/logo_yellow.svg "{{Service}}") +![Cheminformatics with Tailscale](https://docs.api.naturalproducts.net/logo_big.png "Cheminformatics") -This project sets up a {{Service}} instance with Tailscale VPN integration using Docker Compose. It creates a secure, private network connection for your {{Service}} instance using Tailscale. +This project sets up a Cheminformatics instance with Tailscale VPN integration using Docker Compose. It creates a secure, private network connection for your Cheminformatics instance using Tailscale. + +## ** IMPORTANT NOTE ** + +Due to the somewhat atypical nature of this project and the current lack of multi-arch images available in public registries this deployment requires more configuration and depends on a local build of the images to ensure a reliable deployment. ## Prerequisites - Docker and Docker Compose installed on your system - A Tailscale account and auth key (get one from https://login.tailscale.com/admin/authkeys) +- Tailscale SSL certs are enabled in the admin page. - Basic understanding of Docker and networking concepts ## Project Structure ``` -ts-{{service}}/ +ts-cheminformatics/ ├── docker-compose.yml ├── tailscale/ -│ ├── tailscale-data/ # Persistent Tailscale state -│ └── config/ # Tailscale configuration files -└── {{service}}/ - └── config/ # {{Service}} configuration files +│ ├── tailscale-data/ # Persistent Tailscale state +│ └── config/ # Tailscale configuration files +└── cheminformatics-microservice/ # Cheminformatics Source Code ``` ## Setup Instructions 1. **Clone the Repository** - ```bash - git clone https://gitea.damconsulting.llc/DAM/ts-{{service}} - cd ts-{{service}} - ``` + ```bash + git clone https://gitea.damconsulting.llc/DAM/ts-cheminformatics + cd ts-cheminformatics + git clone https://github.com/Steinbeck-Lab/cheminformatics-microservice.git + ``` 2. Create Required Directories ```bash mkdir -p tailscale/tailscale-data @@ -37,8 +42,9 @@ ts-{{service}}/ - Optionally, update the file in `tailscale/config/serve.json` if you need specific Tailscale serve configurations - CAUTION: Changing `"${TS_CERT_DOMAIN}:443": false` to `true` will expose the service to the internet -4. Configure {{Service}} - - See the [documentation]({{service_docs}}) for configuration options +4. Configure Cheminformatics + - At the end of `./ts-cheminformatics/cheminformatics-microservice/Dockerfile` change `--port 80` to `--port 8080` + - See the [documentation](https://docs.api.naturalproducts.net/introduction.html) for supplimental options 5. Start the Services ```bash @@ -48,30 +54,34 @@ ts-{{service}}/ 6. Wait for Certificate to propagate [~2m] 7. Login - - After starting the services your service should be available via tailnet at https://{{service}}.{{YOUR_TAILNET_DOMAIN}}.ts.net ie https://{{service}}.tail12345.ts.net/ + - After starting the services your service should be available via tailnet at https://cheminformatics.{{YOUR_TAILNET_DOMAIN}}.ts.net ie https://cheminformatics.tail12345.ts.net/ ## Services -### {{service}}-ts (Tailscale) +### cheminformatics-ts (Tailscale) - Runs Tailscale VPN client - Image: tailscale/tailscale:latest -- Container name: {{service}}-ts -- Hostname: {{service}} +- Container name: cheminformatics-ts +- Hostname: cheminformatics - Requires NET_ADMIN and SYS_MODULE capabilities - Persists state in ./tailscale/tailscale-data - Uses configuration from ./tailscale/config -### {{service}} +### cheminformatics-backend -- Depends on {{service}}-ts service +- Depends on cheminformatics-ts service + +### cheminformatics-frontend + +- Depends on cheminformatics-ts service ## Usage -- After starting the services your service should be available via tailnet at `https://{{service}}.{{YOUR_TAILNET_DOMAIN}}.ts.net` ie `https://{{service}}.tail12345.ts.net/` +- After starting the services your service should be available via tailnet at `https://cheminformatics.{{YOUR_TAILNET_DOMAIN}}.ts.net` ie `https://cheminformatics.tail12345.ts.net/` - To manually get the Tailscale IP/hostname of your container: ```bash - docker logs {{service}}-ts + docker logs cheminformatics-ts ``` Look for the Tailscale IP address in the logs. @@ -80,29 +90,42 @@ ts-{{service}}/ - Uncomment and adjust the ports mapping if you need direct access (without Tailscale): ```yaml ports: - - 3000:3000 + - 8080:8080 + - 80:80 ``` - Stopping the Services ```bash docker compose down ``` +- Connect to Prometheus + + assuming you already have a prometheus instance in your tailnet add the following to your prometheus.yml configuration file: + + ```yaml + - job_name: 'cheminformatics' + scrape_interval: 10s + metrics_path: /metrics + static_configs: + - targets: ['cheminformatics:8080'] + ``` + ## Troubleshooting - Check container logs: ```bash - docker logs {{service}}-ts - docker logs {{service}} + docker logs cheminformatics-ts + docker logs cheminformatics-backend + docker logs cheminformatics-frontend ``` - Ensure your Tailscale auth key is valid and not expired - Verify the configuration files have proper permissions - Make sure required directories exist before starting ## Notes -- The {{Service}} service uses the Tailscale service's network stack via `network_mode: service:{{service}}-ts` +- The Cheminformatics service uses the Tailscale service's network stack via `network_mode: service:cheminformatics-ts` - Direct port mapping is disabled by default as Tailscale handles the networking - Services restart automatically unless explicitly stopped - For more information: - Tailscale documentation: https://tailscale.com/kb/ - - {{Service}} [documentation]({{service_docs}}) - - {{Service}} [repository]({{service_repo}}) - - {{Service}} [linuxserve.io]({{service_lcsr}}) \ No newline at end of file + - Cheminformatics [documentation](https://docs.api.naturalproducts.net/introduction.html) + - Cheminformatics [repository](https://github.com/Steinbeck-Lab/cheminformatics-microservice/) \ No newline at end of file