Local Deployment (Docker)
Warning
To use this framework, you must master the following knowledge. For related issues, please search and learn independently, or become a member to join the learning community. We do not provide free learning materials for other projects:
- [Must be proficient in] Go Zero
- [Must be proficient in] Docker
- [Must be proficient in] Vben Vben Source Code
- [Must be proficient in one database]
MySQLorPostgreSQL - [Must learn] Ent Getting Started
Development Environment Configuration
Start the Core Backend Service
Save the following docker-compose code as docker-compose.yaml
version: "3"
volumes:
postgresql:
redis:
networks:
simple-admin:
driver: bridge
services:
postgresql:
image: bitnami/postgresql:latest
container_name: postgresql
restart: always
ports:
- "5432:5432"
environment:
POSTGRESQL_DATABASE: "simple_admin"
POSTGRESQL_PASSWORD: "simple-admin."
volumes:
- postgresql:/bitnami/postgresql
networks:
simple-admin:
aliases:
- postgresql-server
deploy:
resources:
limits:
cpus: "0.5"
memory: 1000M
reservations:
cpus: "0.05"
memory: 200M
redis:
image: redis:7.2-alpine
container_name: redis
restart: always
ports:
- "6379:6379"
volumes:
- redis:/data
networks:
simple-admin:
aliases:
- redis-server
deploy:
resources:
limits:
cpus: "0.5"
memory: 500M
reservations:
cpus: "0.05"
memory: 200M
core-rpc:
image: ryanpower/core-rpc-docker:v1.7.6
container_name: core-rpc
restart: always
ports:
- '9101:9101'
networks:
simple-admin:
aliases:
- core-rpc
deploy:
resources:
limits:
cpus: "0.5"
memory: 500M
reservations:
cpus: "0.05"
memory: 200M
core-api:
image: ryanpower/core-api-docker:v1.7.6
container_name: core-api
restart: always
# environment:
# I18N_DIR: ''
# AUTH_SECRET: 'jS6VKDtsJf3z1n2VKDtsJf3z1n2'
ports:
- "9100:9100"
networks:
simple-admin:
aliases:
- core-api
volumes:
- ./api/etc:/app/etc
deploy:
resources:
limits:
cpus: "0.5"
memory: 500M
reservations:
cpus: "0.05"
memory: 200MWarning
If the version number in the deployment code of the document is not the latest, please modify it to the latest version yourself.
Then execute the following command in the folder directory
docker compose up -dto start the server containing only the Core service.
Run the Backend UI
Download Vben5 UI Code
git clone https://github.com/suyuan32/simple-admin-vben5-ui.git
cd simple-admin-vben5-ui
pnpm install
pnpm devVisit http://localhost:5666/init and select "Initialize Core Database" to complete the setup.
Tips
To view a multi-module deployment example, you can visit GitHub
Project Deployment
For modules, simply execute the following commands to build the image:
make build-linux
make dockerFor the backend UI, execute the following command to build the image:
make dockerAfter the image is built, replace the image in the docker compose file with your own image.
Configuration Notes
Warning
- For the Rpc configuration within the module, refer to go zero to configure the Rpc address; otherwise, the system will not work properly.
- The UI requires a reverse proxy configuration. You need to modify
scripts/deploy/nginx.conf. - Configuration files can be mounted to an external file system for dynamic configuration, or directly packaged into the image.