Cheminformatics with Tailscale Integration
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
-
Clone the Repository
git clone https://gitea.damconsulting.llc/DAM/ts-cheminformatics cd ts-cheminformatics git clone https://github.com/Steinbeck-Lab/cheminformatics-microservice.git
-
Create Required Directories
mkdir -p tailscale/tailscale-data
-
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
totrue
will expose the service to the internet
- CAUTION: Changing
- Replace
-
Configure Cheminformatics
- At the end of
./ts-cheminformatics/cheminformatics-microservice/Dockerfile
change--port 80
to--port 8080
- See the documentation for supplimental options
- At the end of
-
Start the Services navigate to
./ts-cheminformatics
docker compose up --build -d
-
Wait for Certificate to propagate [~2m]
-
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
iehttps://cheminformatics.tail12345.ts.net/
- To manually get the Tailscale IP/hostname of your container:
Look for the Tailscale IP address in the logs.docker logs cheminformatics-ts
Optional Features
-
Uncomment and adjust the ports mapping if you need direct access (without Tailscale):
ports: - 8080:8080 - 80:80
-
Stopping the Services
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:
- job_name: 'cheminformatics' scrape_interval: 10s metrics_path: /metrics static_configs: - targets: ['cheminformatics:8080']
Troubleshooting
- Check container logs:
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
- Cheminformatics repository