Skip to content

Commit 520fd0c

Browse files
authored
Merge pull request #1657 from lowcoder-org/deployment_updates
Deployment updates
2 parents 6ef41f5 + 9ca2990 commit 520fd0c

File tree

14 files changed

+382
-150
lines changed

14 files changed

+382
-150
lines changed

.github/workflows/docker-images.yml

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ on:
1010
default: 'latest'
1111
options:
1212
- latest
13+
- stable
1314
- test
14-
- 2.4.6
1515
build_allinone:
1616
type: boolean
1717
description: 'Build the All-In-One image'
@@ -41,24 +41,60 @@ jobs:
4141
build:
4242
runs-on: ubuntu-latest
4343
steps:
44+
- name: 'Setup jq'
45+
uses: dcarbone/install-jq-action@v3
46+
with:
47+
version: '1.7'
48+
4449
- name: Set environment variables
4550
shell: bash
4651
run: |
4752
# Get the short SHA of last commit
4853
echo "SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> "${GITHUB_ENV}"
49-
54+
5055
# Get branch name - we don't use github.ref_head_name since we don't build on PRs
5156
echo "BRANCH_NAME=${{ github.ref_name }}" >> "${GITHUB_ENV}"
52-
57+
5358
# Set docker image tag
54-
echo "IMAGE_TAG=${{ inputs.imageTag || github.ref_name }}" >> "${GITHUB_ENV}"
55-
59+
IMAGE_TAG=${{ inputs.imageTag || github.ref_name }}
60+
61+
# Check whether it's a release
62+
LATEST_TAG=$(
63+
curl -s -L \
64+
-H "Accept: application/vnd.github+json" \
65+
-H "Authorization: Bearer ${{ github.token }}" \
66+
https://api.github.com/repos/${{ github.repository }}/releases/latest \
67+
| jq -r '.tag_name'
68+
)
69+
IS_LATEST="false"
70+
if [[ "${LATEST_TAG}" == "${{ github.event.release.tag_name }}" ]]; then
71+
IS_LATEST="true"
72+
fi;
73+
5674
# Control which images to build
5775
echo "BUILD_ALLINONE=${{ inputs.build_allinone || true }}" >> "${GITHUB_ENV}"
5876
echo "BUILD_FRONTEND=${{ inputs.build_frontend || true }}" >> "${GITHUB_ENV}"
5977
echo "BUILD_NODESERVICE=${{ inputs.build_nodeservice || true }}" >> "${GITHUB_ENV}"
6078
echo "BUILD_APISERVICE=${{ inputs.build_apiservice || true }}" >> "${GITHUB_ENV}"
6179
80+
# Image names
81+
ALLINONE_IMAGE_NAMES=lowcoderorg/lowcoder-ce:${IMAGE_TAG}
82+
FRONTEND_IMAGE_NAMES=lowcoderorg/lowcoder-ce-frontend:${IMAGE_TAG}
83+
APISERVICE_IMAGE_NAMES=lowcoderorg/lowcoder-ce-api-service:${IMAGE_TAG}
84+
NODESERVICE_IMAGE_NAMES=lowcoderorg/lowcoder-ce-node-service:${IMAGE_TAG}
85+
86+
if [[ "${IS_LATEST}" == "true" ]]; then
87+
ALLINONE_IMAGE_NAMES="lowcoderorg/lowcoder-ce:latest,${ALLINONE_IMAGE_NAMES}"
88+
FRONTEND_IMAGE_NAMES="lowcoderorg/lowcoder-ce-frontend:latest,${FRONTEND_IMAGE_NAMES}"
89+
APISERVICE_IMAGE_NAMES="lowcoderorg/lowcoder-ce-api-service:latest,${APISERVICE_IMAGE_NAMES}"
90+
NODESERVICE_IMAGE_NAMES="lowcoderorg/lowcoder-ce-node-service:latest,${NODESERVICE_IMAGE_NAMES}"
91+
fi;
92+
93+
echo "ALLINONE_IMAGE_NAMES=${ALLINONE_IMAGE_NAMES}" >> "${GITHUB_ENV}"
94+
echo "FRONTEND_IMAGE_NAMES=${FRONTEND_IMAGE_NAMES}" >> "${GITHUB_ENV}"
95+
echo "APISERVICE_IMAGE_NAMES=${APISERVICE_IMAGE_NAMES}" >> "${GITHUB_ENV}"
96+
echo "NODESERVICE_IMAGE_NAMES=${NODESERVICE_IMAGE_NAMES}" >> "${GITHUB_ENV}"
97+
6298
- name: Checkout lowcoder source
6399
uses: actions/checkout@v4
64100
with:
@@ -91,7 +127,7 @@ jobs:
91127
linux/amd64
92128
linux/arm64
93129
push: true
94-
tags: lowcoderorg/lowcoder-ce:${{ env.IMAGE_TAG }}
130+
tags: ${{ env.ALLINONE_IMAGE_NAMES }}
95131

96132
- name: Build and push the frontend image
97133
if: ${{ env.BUILD_FRONTEND == 'true' }}
@@ -108,7 +144,7 @@ jobs:
108144
linux/amd64
109145
linux/arm64
110146
push: true
111-
tags: lowcoderorg/lowcoder-ce-frontend:${{ env.IMAGE_TAG }}
147+
tags: ${{ env.FRONTEND_IMAGE_NAMES }}
112148

113149
- name: Build and push the node service image
114150
if: ${{ env.BUILD_NODESERVICE == 'true' }}
@@ -120,7 +156,7 @@ jobs:
120156
linux/amd64
121157
linux/arm64
122158
push: true
123-
tags: lowcoderorg/lowcoder-ce-node-service:${{ env.IMAGE_TAG }}
159+
tags: ${{ env.NODESERVICE_IMAGE_NAMES }}
124160

125161
- name: Build and push the API service image
126162
if: ${{ env.BUILD_APISERVICE == 'true' }}
@@ -132,5 +168,5 @@ jobs:
132168
linux/amd64
133169
linux/arm64
134170
push: true
135-
tags: lowcoderorg/lowcoder-ce-api-service:${{ env.IMAGE_TAG }}
171+
tags: ${{ env.APISERVICE_IMAGE_NAMES }}
136172

deploy/docker/README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Included Dockerfile can be used to build an **all-in-one** image with all requir
44

55
For examples on running the all-in-one image or the multi image deployment see **deploy/docker/docker-compose.yaml** and **deploy/docker/docker-compose-multi.yaml**
66

7+
Environment variables used to configure various aspects of the services are stored in **default.env**, **default-multi.env** and **override.env**. Look into the **default** files to see which variables can be set and what are the default values. To change the defaults, use **override.env**. You don't have to use **--env-file** parameter with **doker compose** because the files are loaded from within `docker-compose.yaml` and `docker-compose-multi.yaml`.
78

89
## all-in-one image
910

@@ -43,21 +44,27 @@ Image can be configured by setting environment variables.
4344
| `LOWCODER_API_RATE_LIMIT` | Number of max Request per Second | `100` |
4445
| `LOWCODER_API_SERVICE_URL` | Lowcoder API service URL | `http://localhost:8080` |
4546
| `LOWCODER_NODE_SERVICE_URL` | Lowcoder Node service (js executor) URL | `http://localhost:6060` |
47+
| `LOWCODER_NODE_SERVICE_SECRET` | Secret used for encrypting communication between API service and Node service - CHANGE IT! | |
48+
| `LOWCODER_NODE_SERVICE_SALT` | Salt used for encrypting communication between API service and Node service - CHANGE IT! | |
4649
| `LOWCODER_MAX_ORGS_PER_USER` | Default maximum organizations per user | `100` |
4750
| `LOWCODER_MAX_MEMBERS_PER_ORG` | Default maximum members per organization | `1000` |
4851
| `LOWCODER_MAX_GROUPS_PER_ORG` | Default maximum groups per organization | `100` |
4952
| `LOWCODER_MAX_APPS_PER_ORG` | Default maximum applications per organization | `1000` |
5053
| `LOWCODER_MAX_DEVELOPERS` | Default maximum developers | `100` |
5154
| `LOWCODER_WORKSPACE_MODE` | SAAS to activate, ENTERPRISE to switch off - Workspaces | `SAAS` |
5255
| `LOWCODER_EMAIL_SIGNUP_ENABLED` | Control if users create their own Workspace automatic when Sign Up | `true` |
56+
| `LOWCODER_EMAIL_AUTH_ENABLED` | Controls whether authentication via email is enabled | `true` |
5357
| `LOWCODER_CREATE_WORKSPACE_ON_SIGNUP` | IF LOWCODER_WORKSPACE_MODE = SAAS, controls if a own workspace is created for the user after sign up | `true` |
5458
| `LOWCODER_MARKETPLACE_PRIVATE_MODE` | Control if not to show Apps on the local Marketplace to anonymous users | `true` |
5559
| `LOWCODER_SUPERUSER_USERNAME` | Username of the Super-User of an Lowcoder Installation | `admin@localhost` |
5660
| `LOWCODER_SUPERUSER_PASSWORD` | Password of the Super-User, if not present or empty, it will be generated | `generated and printed into log file |
57-
61+
| `LOWCODER_PLUGINS_DIR` | Directory holding lowcoder plugins | `/lowcoder-stacks/plugins` |
62+
| `LOWCODER_COOKIE_NAME` | Name of the lowcoder application cookie | `LOWCODER_CE_SELFHOST_TOKEN` |
63+
| `LOWCODER_COOKIE_MAX_AGE` | Lowcoder application cookie max age in hours | `24` |
64+
| `LOWCODER_APP_SNAPSHOT_RETENTIONTIME` | Application snapshots retention time in days | `30` |
5865

5966
Also you should set the API-KEY secret, whcih should be a string of at least 32 random characters. (from Lowcoder v2.3.x on)
60-
On linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256
67+
On linux/mac, generate one eg. with: `head /dev/urandom | head -c 30 | shasum -a 256`
6168

6269
| Environment variable | Description | Default-Value |
6370
|-------------------------------------| ----------------------------------------------------------------------- | ----------------------------------------------------- |
@@ -76,7 +83,7 @@ To enable secure Password Reset flow for the users, you need to configure your o
7683
| `LOWCODER_ADMIN_SMTP_SSL_ENABLED` | Enable SSL encryption | `false` |
7784
| `LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED` | Enable STARTTLS encryption | `true` |
7885
| `LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED` | Require STARTTLS encryption | `true` |
79-
| `LOWCODER_LOST_PASSWORD_EMAIL_SENDER` | "from" Email address of the password Reset Email Sender | `service@lowcoder.cloud` |
86+
| `LOWCODER_EMAIL_NOTIFICATIONS_SENDER` | "from" Email address of the password Reset Email Sender | `info@localhost` |
8087

8188

8289
## Building api-service image
@@ -119,6 +126,12 @@ Image can be configured by setting environment variables.
119126
| `LOWCODER_MARKETPLACE_PRIVATE_MODE` | Control if not to show Apps on the local Marketplace to anonymous users | `true` |
120127
| `LOWCODER_SUPERUSER_USERNAME` | Username of the Super-User of an Lowcoder Installation | `admin@localhost` |
121128
| `LOWCODER_SUPERUSER_PASSWORD` | Password of the Super-User, if not present or empty, it will be generated | `generated and printed into log file |
129+
| `LOWCODER_PLUGINS_DIR` | Directory holding lowcoder plugins | `/lowcoder-stacks/plugins` |
130+
| `LOWCODER_COOKIE_NAME` | Name of the lowcoder application cookie | `LOWCODER_CE_SELFHOST_TOKEN` |
131+
| `LOWCODER_COOKIE_MAX_AGE` | Lowcoder application cookie max age in hours | `24` |
132+
| `LOWCODER_APP_SNAPSHOT_RETENTIONTIME` | Application snapshots retention time in days | `30` |
133+
| `LOWCODER_NODE_SERVICE_SECRET` | Secret used for encrypting communication between API service and Node service - CHANGE IT! | |
134+
| `LOWCODER_NODE_SERVICE_SALT` | Salt used for encrypting communication between API service and Node service - CHANGE IT! | |
122135

123136
Also you should set the API-KEY secret, whcih should be a string of at least 32 random characters. (from Lowcoder v2.3.x on)
124137
On linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256
@@ -140,7 +153,7 @@ To enable secure Password Reset flow for the users, you need to configure your o
140153
| `LOWCODER_ADMIN_SMTP_SSL_ENABLED` | Enable SSL encryption | `false` |
141154
| `LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED` | Enable STARTTLS encryption | `true` |
142155
| `LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED` | Require STARTTLS encryption | `true` |
143-
| `LOWCODER_LOST_PASSWORD_EMAIL_SENDER` | "from" Email address of the password Reset Email Sender | `service@lowcoder.cloud` |
156+
| `LOWCODER_EMAIL_NOTIFICATIONS_SENDER` | "from" Email address of the password Reset Email Sender | `info@localhost` |
144157

145158
## Building node-service image
146159

@@ -163,6 +176,8 @@ Image can be configured by setting environment variables.
163176
| `LOWCODER_PUID` | ID of user running services. It will own all created logs and data. | `9001` |
164177
| `LOWCODER_PGID` | ID of group of the user running services. | `9001` |
165178
| `LOWCODER_API_SERVICE_URL` | Lowcoder API service URL | `http://localhost:8080` |
179+
| `LOWCODER_NODE_SERVICE_SECRET` | Secret used for encrypting communication between API service and Node service - CHANGE IT! | |
180+
| `LOWCODER_NODE_SERVICE_SALT` | Salt used for encrypting communication between API service and Node service - CHANGE IT! | |
166181

167182
## Building web frontend image
168183

deploy/docker/default-multi.env

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#####################################################################
2+
## ##
3+
## Lowcoder environment variables override for multi image ##
4+
## installation. ##
5+
## ##
6+
## !!! PLEASE DO NOT CHANGE THIS FILE !!! ##
7+
## ##
8+
## To change the variables use file: override.env ##
9+
## ##
10+
## It will be loaded automatically and will override the defaults ##
11+
## You don't have to copy the whole default.env, only the changed ##
12+
## environment variables. ##
13+
## ##
14+
#####################################################################
15+
16+
# Update individual service URLs to match the multi setup
17+
LOWCODER_MONGODB_URL="mongodb://lowcoder:secret123@mongodb/lowcoder?authSource=admin"
18+
LOWCODER_REDIS_URL="redis://redis:6379"
19+
LOWCODER_NODE_SERVICE_URL="http://lowcoder-node-service:6060"
20+
LOWCODER_API_SERVICE_URL="http://lowcoder-api-service:8080"
21+

0 commit comments

Comments
 (0)