blis-cloud-cli 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ import click
2
+ import docker
3
+
4
+ from blis_cli.util import bash
5
+ from blis_cli.util import caddy
6
+ from blis_cli.util import config
7
+ from blis_cli.util import docker_util
8
+
9
+
10
+ def run():
11
+ restart_blis = False
12
+ if docker_util.blis_is_running():
13
+ if not docker_util.stop_blis_with_confirm():
14
+ return 1
15
+ restart_blis = True
16
+
17
+ click.echo("Updating BLIS... ", nl=False)
18
+ out, err = bash.run(f"{docker_util.compose()} -f {config.compose_file()} pull app")
19
+ if err:
20
+ click.secho("Failed", fg="red")
21
+ click.echo(err, err=True)
22
+ return 1
23
+ click.secho("Success!", fg="green")
24
+
25
+ if not caddy.installed():
26
+ click.echo("Installing Caddy... ", nl=False)
27
+ try:
28
+ caddy.install()
29
+ click.secho("Success!", fg="green")
30
+ except Exception as e:
31
+ click.secho(e, fg="red")
32
+ return 1
33
+
34
+ if restart_blis:
35
+ return docker_util.start_blis("app")
36
+
37
+ return 0
@@ -0,0 +1,57 @@
1
+ version: '3'
2
+
3
+ #####
4
+ # This file is an example docker-compose file for deploying BLIS to a cloud provider
5
+ # This file is used as a template, but will be rewritten by the BLIS tool as necessary.
6
+
7
+ name: c4gblis
8
+
9
+ services:
10
+ caddy:
11
+ image: caddy:2
12
+ restart: unless-stopped
13
+ cap_add:
14
+ - NET_ADMIN
15
+ ports:
16
+ - "80:80"
17
+ - "443:443"
18
+ - "443:443/udp"
19
+ volumes:
20
+ - ./Caddyfile:/etc/caddy/Caddyfile
21
+ - caddy_data:/data
22
+ - caddy_config:/config
23
+
24
+ app:
25
+ image: "ghcr.io/c4g/blis:latest"
26
+ restart: unless-stopped
27
+ environment:
28
+ DB_HOST: 'db'
29
+ DB_PORT: '3306'
30
+ DB_USER: 'root'
31
+ DB_PASS: 'blis123'
32
+ depends_on:
33
+ - caddy
34
+ - db
35
+ volumes:
36
+ - blis-files:/var/www/blis/files
37
+ - blis-logs:/var/www/blis/log
38
+
39
+ db:
40
+ image: mysql:5.7
41
+ command: --default-authentication-plugin=mysql_native_password --innodb-strict-mode=OFF --sql-mode=""
42
+ restart: unless-stopped
43
+ volumes:
44
+ - blis-mysql:/var/lib/mysql
45
+ environment:
46
+ MYSQL_ROOT_PASSWORD: blis123
47
+ healthcheck:
48
+ test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot", "-pblis123"]
49
+ timeout: 20s
50
+ retries: 10
51
+
52
+ volumes:
53
+ blis-files:
54
+ blis-logs:
55
+ blis-mysql:
56
+ caddy_data:
57
+ caddy_config: