Skip to content
Adam edited this page Aug 25, 2021 · 6 revisions

Statping is easily ran on Docker with the light weight Alpine linux image. View on Docker Hub or quay.io

Docker Image Version Docker Image Size Docker Pulls Quay Container

Volume Mount

  • /app - Working directory in container. This directory will hold all configs, logs, assets, and sqlite database.

Latest Docker Image

The latest Docker image uses Alpine Linux to keep it ultra small.

docker run -d \
  -p 8080:8080 \
  --restart always \
  adamboutcher/statping-ng

Mounting Volume

You can mount a volume to the /app Statping directory. This folder will contain logs, config.yml, and static assets if you want to edit the SCSS/CSS.

docker run -d \
  -p 8080:8080 \
  -v /mydir/statping:/app \
  --restart always \
  adamboutcher/statping-ng

Attach a SSL Certificate

When you mount server.crt and server.key to the /app directory, Statping will run a HTTPS server on port 443. Checkout the SSL Wiki documentation to see more information about this.

docker run -d \
  -p 443:443 \
  -v /mydir/domain.crt:/app/server.crt \
  -v /mydir/domain.key:/app/server.key \
  -v /mydir:/app \
  --restart always \
  adamboutcher/statping-ng

Docker or Quay.io

Whether you want to use DockerHub or Quay.io, we have an image. Simply change adamboutcher/statping-ng for quay.io/statping-ng/statping-ng if you'd prefer to use Quay.io, all the examples and docker files use dockerhub by default.

Development Docker Image

If you want to run Statping that was build from the source, use the dev Docker image.

docker run -d -p 8080:8080 adamboutcher/statping-ng:dev

Cypress Testing Docker Image

This Docker image will pull the latest version of Statping and test the web interface with Cypress.

docker run -it -p 8080:8080 adamboutcher/statping-ng:cypress

Or use Docker Compose

This Docker Compose file inlcudes NGINX, Postgres, and Statping.

Docker Compose with NGINX and Postgres

Once you initiate the docker-compose.yml file below go to http:https://localhost and you'll be forwarded to the /setup page. Database Authentication

  • database: postgres
  • port: 5432
  • username: statup
  • password: password123
  • database: statup
version: '2.3'

services:

  nginx:
    container_name: nginx
    image: jwilder/nginx-proxy
    ports:
      - 0.0.0.0:80:80
      - 0.0.0.0:443:443
    networks:
      - internet
    restart: always
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./statup/nginx/certs:/etc/nginx/certs:ro
      - ./statup/nginx/vhost:/etc/nginx/vhost.d
      - ./statup/nginx/html:/usr/share/nginx/html:ro
      - ./statup/nginx/dhparam:/etc/nginx/dhparam
    environment:
      DEFAULT_HOST: localhost

  statup:
    container_name: statup
    image: adamboutcher/statping-ng:latest
    restart: always
    networks:
      - internet
      - database
    depends_on:
      - postgres
    volumes:
      - ./statup/app:/app
    environment:
      VIRTUAL_HOST: localhost
      VIRTUAL_PORT: 8080
      DB_CONN: postgres
      DB_HOST: postgres
      DB_USER: statup
      DB_PASS: password123
      DB_DATABASE: statup
      NAME: EC2 Example
      DESCRIPTION: This is a Statping Docker Compose instance

  postgres:
    container_name: postgres
    image: postgres:10
    restart: always
    networks:
      - database
    volumes:
      - ./statup/postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: password123
      POSTGRES_USER: statup
      POSTGRES_DB: statup

networks:
  internet:
    driver: bridge
  database:
    driver: bridge

Or a simple wget...

wget https://raw.githubusercontent.com/statping-ng/statping-ng/master/servers/docker-compose.yml
docker-compose up -d

Docker Compose with Automatic SSL

You can automatically start a Statping server with automatic SSL encryption using this docker-compose file. First point your domain's DNS to the Statping server, and then run this docker-compose command with DOMAIN and EMAIL. Email is for letsencrypt services.

wget https://raw.githubusercontent.com/statping-ng/statping-ng/master/servers/docker-compose-ssl.yml

LETSENCRYPT_HOST=mydomain.com \
    [email protected] \
    docker-compose -f docker-compose-ssl.yml up -d

Full docker-compose with Automatic SSL

version: '2.3'

services:

  nginx:
    container_name: nginx
    image: jwilder/nginx-proxy
    ports:
      - 0.0.0.0:80:80
      - 0.0.0.0:443:443
    labels:
      - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
    networks:
      - internet
    restart: always
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./statup/nginx/certs:/etc/nginx/certs:ro
      - ./statup/nginx/vhost:/etc/nginx/vhost.d
      - ./statup/nginx/html:/usr/share/nginx/html:ro
      - ./statup/nginx/dhparam:/etc/nginx/dhparam
    environment:
      DEFAULT_HOST: ${LETSENCRYPT_HOST}

  letsencrypt:
    container_name: letsencrypt
    image: jrcs/letsencrypt-nginx-proxy-companion
    networks:
      - internet
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./statup/nginx/certs:/etc/nginx/certs
      - ./statup/nginx/vhost:/etc/nginx/vhost.d
      - ./statup/nginx/html:/usr/share/nginx/html
      - ./statup/nginx/dhparam:/etc/nginx/dhparam

  statup:
    container_name: statup
    image: adamboutcher/statping-ng:latest
    restart: always
    networks:
      - internet
      - database
    depends_on:
      - postgres
    volumes:
      - ./statup/app:/app
    environment:
      VIRTUAL_HOST: ${LETSENCRYPT_HOST}
      VIRTUAL_PORT: 8080
      LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
      LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
      DB_CONN: postgres
      DB_HOST: postgres
      DB_USER: statup
      DB_PASS: password123
      DB_DATABASE: statup
      NAME: SSL Example
      DESCRIPTION: This Status Status Page should be running ${LETSENCRYPT_HOST} with SSL.

  postgres:
    container_name: postgres
    image: postgres:10
    restart: always
    networks:
      - database
    volumes:
      - ./statup/postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: password123
      POSTGRES_USER: statup
      POSTGRES_DB: statup

networks:
  internet:
    driver: bridge
  database:
    driver: bridge
Clone this wiki locally