# Cheminformatics with Tailscale Integration ![Cheminformatics with Tailscale](https://docs.api.naturalproducts.net/logo_big.png "Cheminformatics") 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-cheminformatics/ ├── docker-compose.yml ├── tailscale/ │ ├── 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-cheminformatics cd ts-cheminformatics git clone https://github.com/Steinbeck-Lab/cheminformatics-microservice.git ``` 2. Create Required Directories ```bash mkdir -p tailscale/tailscale-data ``` 3. Configure Tailscale - Replace `{{YOUR_TAILSCALE_AUTHKEY}}` in the docker-compose.yml with your actual Tailscale auth key - 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 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 navigate to `./ts-cheminformatics` ```bash docker compose up --build -d ``` 6. Wait for Certificate to propagate [~2m] 7. Login - 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/ - Your backend api is available at http://cheminformatics.tail12345.ts.net:8080/ ## Services ### cheminformatics-ts (Tailscale) - Runs Tailscale VPN client - Image: tailscale/tailscale:latest - Container name: cheminformatics-ts - Hostname: cheminformatics - Requires NET_ADMIN and SYS_MODULE capabilities - Persists state in ./tailscale/tailscale-data - Uses configuration from ./tailscale/config ### cheminformatics-backend - 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://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 cheminformatics-ts ``` Look for the Tailscale IP address in the logs. ## Optional Features - Uncomment and adjust the ports mapping if you need direct access (without Tailscale): ```yaml ports: - 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 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 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/ - Cheminformatics [documentation](https://docs.api.naturalproducts.net/introduction.html) - Cheminformatics [repository](https://github.com/Steinbeck-Lab/cheminformatics-microservice/)