Skip to content

Instantly share code, notes, and snippets.

@myagizmaktav
Last active May 16, 2025 09:47
Show Gist options
  • Select an option

  • Save myagizmaktav/10ab38bc4389e549e6bf47fd5aed9064 to your computer and use it in GitHub Desktop.

Select an option

Save myagizmaktav/10ab38bc4389e549e6bf47fd5aed9064 to your computer and use it in GitHub Desktop.
Atheos Docker compose example

Atheos Docker Setup with Traefik

This document describes how to set up the Atheos IDE using Docker Compose, configured to work behind a Traefik reverse proxy.

Prerequisites

  1. Docker and Docker Compose: Ensure Docker and Docker Compose are installed on your host machine.
  2. Traefik: A running Traefik instance is required. This setup assumes:
    • Traefik is connected to an external Docker network named network.
    • You have a certificate resolver configured named myresolver (though TLS is currently disabled in the labels).
  3. External Docker Network: The Docker overlay network named network must exist. If not, create it:
    docker network create --driver=overlay --attachable network
  4. Host Directory: Create a directory on your host machine to store Atheos configuration and workspace data. The example uses /root/nerius. Choose a suitable location for your system.

Configuration (docker-atheos-compose.yml)

Save the following content as docker-atheos-compose.yml:

version: "3.8"

services:
  atheos:
    image: hlsiira/atheos
    container_name: atheos
    # Optional: Expose port directly if not using Traefik
    # ports:
    #  - "8080:80"
    volumes:
      # Mount your host directory to the Atheos config/workspace
      # IMPORTANT: Replace /root/nerius with the actual path on your host
      - /root/nerius:/var/www/html/workspace/config
    # user: "0:0" # Attempt to run as root (doesn't fix internal permissions)
    networks:
      - network
    environment:
      # These may not be used by this specific image, host permissions are key
      - UID=0
      - GID=0
    labels:
      # --- Traefik Labels ---
      - "traefik.enable=true"
      # Change hostname to your desired URL
      - "traefik.http.routers.atheos.rule=Host(`nerius.timarhane.gg`)"
      - "traefik.http.routers.atheos.entrypoints=websecure" # Assumes 'websecure' entrypoint (port 443)
      - "traefik.http.services.atheos.loadbalancer.server.port=80" # Internal port Atheos listens on

      # Optional: Enable TLS/SSL via Traefik
      # - "traefik.http.routers.atheos.tls=true"
      # - "traefik.http.routers.atheos.tls.certresolver=myresolver" # Your cert resolver

      # Optional: Basic Auth Middleware (define middleware in Traefik config)
      # - "traefik.http.routers.atheos.middlewares=atheos-auth"
    restart: unless-stopped

networks:
  network:
    # Assumes 'network' is an existing external overlay network managed by Docker Swarm or created manually
    name: network
    external: true

Key Configuration Points:

  • volumes: Crucially, change /root/nerius to the path you created on your host machine in the prerequisites.
  • labels:
    • Modify Host(\nerius.timarhane.gg`)to use the actual hostname you want to access Atheos through (e.g.,atheos.yourdomain.com`). Ensure your DNS points this hostname to your Traefik server.
    • The router and service names are set to atheos.
    • TLS is currently disabled (tls=false). Uncomment the TLS lines and ensure your certresolver is correct if you want HTTPS.

IMPORTANT: Setting Host Directory Permissions

This is the most critical step to prevent "No Read/Write Permission" errors within Atheos.

The Atheos application (specifically, the Apache web server running it) inside the container operates as the user www-data, which typically has UID=33 and GID=33 in Debian-based images like the one likely used here.

You must set the ownership of the directory on your host machine (the one you mapped in the volumes section) to match this UID and GID.

  1. Identify your host path: In the example, it's /root/nerius. Replace this with your actual path.

  2. Run the chown command on your host:

    sudo chown -R 33:33 /root/nerius

    (Replace /root/nerius with your actual host path)

Failure to do this will result in permission errors because the www-data process inside the container won't be allowed to write to the directory owned by a different user (like root) on the host.

Deployment

  1. Save the configuration above as docker-atheos-compose.yml.
  2. Navigate to the directory containing the file in your terminal.
  3. Deploy the stack using Docker Compose:
    docker-compose -f docker-atheos-compose.yml up -d
    (Alternatively, if using Portainer, deploy it as a new stack using the compose file content.)

Accessing Atheos

Once the container is running and Traefik has picked up the configuration, open your web browser and navigate to the hostname you configured in the Traefik labels (e.g., http://nerius.timarhane.gg or https://nerius.timarhane.gg if you enabled TLS).

You should see the Atheos initial setup screen or login page.

Troubleshooting

  • Permission Errors: Double-check that you ran the sudo chown -R 33:33 /your/host/path command correctly on the host machine before starting the container. Verify ownership with ls -ld /your/host/path.
  • 502/Gateway Errors: Ensure the atheos container is running (docker ps), connected to the network, and that Traefik can reach it. Check Traefik logs.
  • Container Logs: Check the Atheos container logs for specific errors: docker logs atheos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment