Skip to content

Commit 993423e

Browse files
authored
Merge pull request #1336 from Websoft9/update-unleash-7ae60e5b
Update unleash
2 parents 33fcdf0 + 0a5fac8 commit 993423e

File tree

6 files changed

+64
-167
lines changed

6 files changed

+64
-167
lines changed

apps/unleash/.env

Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,34 @@
1-
W9_REPO="wordpress"
2-
W9_DIST=community
3-
W9_VERSION="latest"
1+
W9_REPO="unleashorg/unleash-server"
2+
W9_DIST='community'
3+
W9_VERSION='latest'
4+
W9_POWER_PASSWORD='2InvwI3jGiP6etA'
5+
W9_ID='unleash'
6+
W9_HTTP_PORT_SET='9001'
7+
W9_HTTP_PORT=4242
48

5-
W9_POWER_PASSWORD="1PrMxExC45LsCT"
69

7-
# Environments which for user settings when create application
8-
# Named expression: W9_xxx_xxx_SET, xxx refer to file fields
9-
W9_HTTP_PORT_SET=9001
10-
# W9_HTTPS_PORT_SET=9002
11-
# W9_DB_PORT_SET=3306
12-
# W9_SSH_PORT_SET=23
13-
W9_KEY_SET="dfsjdkjf77xjxcjcj"
14-
15-
#### -- Not allowed to edit below environments when recreate app based on existing data -- ####
16-
17-
W9_ID=unleash
10+
W9_LOGIN_USER=admin
11+
W9_LOGIN_PASSWORD=unleash4all
1812

19-
# W9_HTTP_PORT or W9_HTTPS_PORT is need at leaset and used for proxy for web application
20-
# Some container (e.g teleport) need HTTPS access, then need to set this pra
21-
W9_HTTP_PORT=80
22-
W9_HTTPS_PORT=81
2313

24-
W9_LOGIN_USER=admin
25-
# use https://1password.com/zh-cn/password-generator/ to genarate 14 bit password
26-
# this password can also use password file
27-
W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD
28-
W9_ADMIN_PATH="/wp-login"
29-
30-
# Container name's suffix must use one of the value
31-
W9_DB_EXPOSE="mysql,postgresql,mariadb,mongodb,redis"
32-
33-
# It is used when the application APP needs to set an external URL, which can be IP(or domain), IP:PORT
34-
# If have protocols, should be set it in the APP's ENV
35-
W9_URL=internet_ip:$W9_HTTP_PORT_SET
36-
# modifies W9_URL on init when it is true
14+
W9_DB_EXPOSE="postgresql"
15+
W9_URL='internet_ip:$W9_HTTP_PORT_SET'
3716
W9_URL_REPLACE=true
38-
3917
W9_NETWORK=websoft9
4018

4119
#### ----------------------------------------------------------------------------------------- ####
4220

4321

44-
# Below environment is created by this app
45-
46-
WORDPRESS_DB_HOST=$W9_ID-mariadb
47-
WORDPRESS_DB_USER=wordpress #if use postgresql, it need set to postgres
48-
WORDPRESS_DB_PASSWORD=$W9_POWER_PASSWORD
49-
WORDPRESS_DB_NAME=wordpress
50-
22+
# Below environment is created by this app: https://docs.getunleash.io/using-unleash/deploy/configuring-unleash
5123

52-
#W9_NAME=""
53-
#W9_RCODE=""
24+
#DB URL not allowed # string
25+
DATABASE_URL: "postgres://postgres:${W9_POWER_PASSWORD}@${W9_ID}-postgresql/unleash"
26+
DATABASE_SSL: "false"
27+
LOG_LEVEL: "warn"
28+
# Proxy clients must use one of these keys to connect to the
29+
# Proxy. To add more keys, separate them with a comma (`key1,key2`).
30+
INIT_FRONTEND_API_TOKENS: "default:development.unleash-insecure-frontend-api-token"
31+
# Initialize Unleash with a default set of client API tokens. To
32+
# initialize Unleash with multiple tokens, separate them with a
33+
# comma (`token1,token2`).
34+
INIT_CLIENT_API_TOKENS: "default:development.unleash-insecure-api-token"

apps/unleash/Dockerfile

Lines changed: 0 additions & 21 deletions
This file was deleted.

apps/unleash/docker-compose.yml

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,52 @@
1-
# image,docs: https://hub.docker.com/_/wordpress/
1+
# image: https://github.com/Unleash/unleash/blob/main/docker-compose.yml
2+
# docs: https://github.com/Unleash/unleash
23

34
services:
4-
5-
wordpress:
5+
unleash:
66
image: $W9_REPO:$W9_VERSION
77
container_name: $W9_ID
88
restart: unless-stopped
9-
#This is for access host from container
10-
# extra_hosts: ["host.docker.internal:host-gateway"]
11-
# command: |
12-
# /bin/bash -c "ping -c 3 host.docker.internal"
13-
logging:
14-
driver: "json-file"
15-
options:
16-
max-file: "5"
17-
max-size: 10m
18-
deploy:
19-
resources:
20-
limits:
21-
memory: 5g
22-
cpus: '0.7'
239
ports:
24-
- $W9_HTTP_PORT_SET:80
25-
env_file: .env
26-
volumes:
27-
- wordpress:/var/www/html
28-
- ./src/php_exra.ini:/usr/local/etc/php/conf.d/php_exra.ini
10+
- $W9_HTTP_PORT_SET:4242
11+
env_file:
12+
- .env
13+
depends_on:
14+
db:
15+
condition: service_healthy
16+
command: [ "node", "index.js" ]
17+
healthcheck:
18+
test: wget --no-verbose --tries=1 --spider http://localhost:4242/health || exit 1
19+
interval: 1s
20+
timeout: 1m
21+
retries: 5
22+
start_period: 15s
2923

30-
mariadb:
31-
image: mariadb:10.4
32-
container_name: $W9_ID-mariadb
24+
db:
25+
image: postgres:15
26+
container_name: $W9_ID-postgresql
3327
restart: unless-stopped
34-
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_log_buffer_size=30M
28+
healthcheck:
29+
test:
30+
[
31+
"CMD",
32+
"pg_isready",
33+
"--username=postgres",
34+
"--host=127.0.0.1",
35+
"--port=5432"
36+
]
37+
interval: 2s
38+
timeout: 1m
39+
retries: 5
40+
start_period: 10s
3541
volumes:
36-
- mysql_data:/var/lib/mysql
42+
- pgdata:/var/lib/postgresql/data
3743
environment:
38-
MYSQL_DATABASE: $WORDPRESS_DB_NAME
39-
MYSQL_USER: $WORDPRESS_DB_USER
40-
MYSQL_PASSWORD: $W9_POWER_PASSWORD
41-
MYSQL_ROOT_PASSWORD: $W9_POWER_PASSWORD
44+
POSTGRES_DB: unleash
45+
POSTGRES_USER: postgres
46+
POSTGRES_PASSWORD: ${W9_POWER_PASSWORD}
4247

4348
volumes:
44-
wordpress:
45-
mysql_data:
49+
pgdata:
4650

4751
networks:
4852
default:

apps/unleash/src/nginx-proxy.conf.template

Lines changed: 0 additions & 57 deletions
This file was deleted.

apps/unleash/src/php_exra.ini

Lines changed: 0 additions & 8 deletions
This file was deleted.

apps/unleash/variables.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
"edition": [
88
{
99
"dist": "community",
10-
"version": [
11-
"latest"
12-
]
10+
"version": ["6","latest"]
1311
}
1412
],
1513
"requirements": {
16-
"cpu": "2",
17-
"memory": "4",
18-
"disk": "10",
14+
"cpu": "1",
15+
"memory": "2",
16+
"disk": "1",
1917
"url": "https://getunleash.io"
2018
}
2119
}

0 commit comments

Comments
 (0)