Self-Hosted Deployment

Vigilant is in early development. Not all features are implemented and there are probably a few bugs. Feedback is greatly appreciated!

Vigilant can easily be deployed using Docker Compose.

Use the following docker-compose file:

services:
    app:
        image: ghcr.io/govigilant/vigilant:latest
        volumes:
            - .env:/app/.env
            - ./storage:/app/storage
            - public:/app/public
        restart: always
        working_dir: /app
        networks:
            - vigilant
        healthcheck:
            test: curl --fail http://localhost || exit 1
            interval: 30s
            timeout: 10s
            retries: 5
        depends_on:
            mysql:
                condition: service_healthy
        ports:
            - "8000:8000"

    horizon:
        image: ghcr.io/govigilant/vigilant:latest
        volumes:
            - .env:/app/.env
            - ./storage:/app/storage
            - public:/app/public
        restart: always
        working_dir: /app
        networks:
            - vigilant
        entrypoint: ["php", "artisan", "horizon"]
        depends_on:
            mysql:
                condition: service_healthy
            redis:
                condition: service_healthy

    mysql:
        image: mysql:8.0
        restart: always
        environment:
            - MYSQL_DATABASE=vigilant
            - MYSQL_ROOT_PASSWORD=password
        volumes:
            - database:/var/lib/mysql
        networks:
            - vigilant
        healthcheck:
            test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
            interval: 10s
            timeout: 20s
            retries: 10

    redis:
        image: redis:7
        volumes:
            - redis:/data
        networks:
            - vigilant
        healthcheck:
            test: [ "CMD", "redis-cli", "ping" ]

networks:
    vigilant:

volumes:
    public:
    database:
    redis:

Then create an environment file: touch .env and add these variables:

APP_KEY=
APP_URL=http://vigilant.govigilant.io

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=vigilant
DB_USERNAME=root
DB_PASSWORD=password

REDIS_HOST=redis
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

Adjust your URL, if you plan on using e-mail notifications you can setup email here too.
Do not set the APP_KEY, it will be generated when you first start the container.

Start the application using docker-compose up. The application will be available on port 8000.

After starting the container once you may optionally set the .env file to read only using:

            - type: bind
              source: ./.env
              target: /app/.env
              read_only: true

HTTPS

Use a reverse proxy such as nginx or Traefik to handle HTTPS. Example nginx configuration:

server {
    listen 80;
    server_name vigilant.example.com;

    # Redirect all HTTP traffic to HTTPS
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name vigilant.example.com;

    # SSL certificate and key files
    ssl_certificate /path/to/your/cert/certpem;
    ssl_certificate_key /path/to/your/cert/priveate.pem;

    # SSL configuration
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Other Architectures

Currently Vigilant only supports Intel based CPU's. If you are for example on Apple silicon you have to build the image yourself.

To do this, clone the git repository: git clone [email protected]:govigilant/vigilant.git

Create your env: cp .env.docker .env

Replace the image with a build parameter in your docker-compose.yml

    app:
-        image: ghcr.io/govigilant/vigilant:latest
+        build:
+            context: .

...
    horizon:
-        image: ghcr.io/govigilant/vigilant:latest
+        build:
+            context: .

Then run docker-compose up