diff --git a/config.development.json b/config.development.json index 8594f11..b3097c5 100644 --- a/config.development.json +++ b/config.development.json @@ -1,7 +1,7 @@ { - "url": "http://localhost:2368", + "url": "http://localhost:3001", "server": { - "port": 2368, + "port": 3001, "host": "::" }, "mail": { diff --git a/config.production.template b/config.production.template index fc1f089..a2682da 100644 --- a/config.production.template +++ b/config.production.template @@ -1,7 +1,7 @@ { - "url": "http://localhost:2368", + "url": "$URL", "server": { - "port": 2368, + "port": $PORT, "host": "::" }, "mail": $EMAIL, diff --git a/deploy-localhost.sh b/deploy-localhost.sh new file mode 100644 index 0000000..cee0987 --- /dev/null +++ b/deploy-localhost.sh @@ -0,0 +1,3 @@ +docker stack rm rose-ash +. ./.env +for i in 1 2 3 4 5 6 7 8 9 10; do sleep 5 && docker stack deploy -c docker-compose-localhost.yml rose-ash && break ; done diff --git a/deploy.sh b/deploy.sh index 1868e13..297e3ec 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,4 @@ docker stack rm rose-ash . ./.env -echo $CERTBOT_EMAIL -echo $DOMAIN +export NODE=$1 for i in 1 2 3 4 5 6 7 8 9 10; do sleep 5 && docker stack deploy -c docker-compose.yml rose-ash && break ; done diff --git a/docker-compose-localhost.yml b/docker-compose-localhost.yml new file mode 100644 index 0000000..2d79234 --- /dev/null +++ b/docker-compose-localhost.yml @@ -0,0 +1,75 @@ +version: "3.3" +services: + ghost: + image: rose-ash-ghost:latest + env_file: + - ./.env + volumes: + - ghost-content:/var/lib/ghost/content + - ./settings:/var/lib/ghost/content/settings + - ./themes/:/var/lib/ghost/content/themes + networks: + - appnet + - externalnet + secrets: + - email + - db-password + #ports: + # - 2368:2368 + deploy: + placement: + constraints: [node.labels.node == production ] + + invite-token: + image: invite-token + environment: + MYSQL_USER: ghost + MYSQL_PASSWORD: ghostdbpass + MYSQL_DATABASE: ghostdb + MYSQL_HOST: db + PORT: 3002 + networks: + - appnet + - externalnet + deploy: + placement: + constraints: [node.labels.node == production ] + ports: + # donot expose in production!!! + - 3010:3002 + + db: + image: rose-ash-mysql:latest + environment: + MYSQL_ROOT_PASSWORD: mysqlrootpass + MYSQL_USER: ghost + MYSQL_PASSWORD: ghostdbpass + MYSQL_DATABASE: ghostdb + volumes: + - ghost-mysql-db:/var/lib/mysql + networks: + - appnet + secrets: + - db-password + - db-root-password + deploy: + placement: + constraints: [node.labels.node == production ] +volumes: + ghost-content: + ghost-config: + ghost-mysql-db: +networks: + appnet: + driver: overlay + externalnet: + driver: overlay + external: true +secrets: + email: + file: ./.email + db-password: + file: ./.db-password + db-root-password: + file: ./.db-root-password + diff --git a/docker-compose.yml b/docker-compose.yml index 89644c1..52f776d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,9 +2,8 @@ version: "3.3" services: ghost: image: rose-ash-ghost:latest - environment: - url: https://rose-ash.com/ - NODE_ENV: production + env_file: + - ./.env volumes: - ghost-content:/var/lib/ghost/content - ./settings:/var/lib/ghost/content/settings @@ -15,9 +14,11 @@ services: secrets: - email - db-password + #ports: + # - 2368:2368 deploy: placement: - constraints: [node.labels.node == production ] + constraints: [node.labels.node == $NODE ] invite-token: image: invite-token @@ -32,7 +33,10 @@ services: - externalnet deploy: placement: - constraints: [node.labels.node == production ] + constraints: [node.labels.node == $NODE ] + ports: + # donot expose in production!!! + #- 3010:3002 db: image: rose-ash-mysql:latest @@ -50,7 +54,7 @@ services: - db-root-password deploy: placement: - constraints: [node.labels.node == production ] + constraints: [node.labels.node == $NODE ] volumes: ghost-content: ghost-config: