diff --git a/sea-orm-pro/docs/01-index.md b/sea-orm-pro/docs/01-index.md index 1615bac85f..fe7877fb19 100644 --- a/sea-orm-pro/docs/01-index.md +++ b/sea-orm-pro/docs/01-index.md @@ -42,4 +42,6 @@ 6. Deployment - 6.1 [Nginx](06-deployment/01-nginx.md) + 6.1 [Virtual Machine](06-deployment/01-vm.md) + + 6.2 [Container](06-deployment/02-container.md) diff --git a/sea-orm-pro/docs/06-deployment/01-nginx.md b/sea-orm-pro/docs/06-deployment/01-nginx.md deleted file mode 100644 index 79a26316ed..0000000000 --- a/sea-orm-pro/docs/06-deployment/01-nginx.md +++ /dev/null @@ -1,46 +0,0 @@ -# Nginx - -You can serve the admin panel through Nginx. - -First build the frontend artifact. - -```sh -cd sea-orm-pro - -# Install dependency -npm install - -# Run frontend in development mode -# Visit admin at `http://localhost:8085/` -npm run dev - -# Build frontend artifact -npm run build - -# Copy frontend artifact to backend and serve statically -... -``` - -Then start the backend server. - -```sh -cd sea-orm-pro - -cargo run start -``` - -Finally proxy request to the backend server with Nginx. - -``` -server { - root /var/www/sea-orm-pro/; - - server_name sea-orm-pro.sea-ql.org; - - location / { - proxy_pass http://127.0.0.1:8086; - } - - listen 80; -} -``` diff --git a/sea-orm-pro/docs/06-deployment/01-vm.md b/sea-orm-pro/docs/06-deployment/01-vm.md new file mode 100644 index 0000000000..1df01e9ec2 --- /dev/null +++ b/sea-orm-pro/docs/06-deployment/01-vm.md @@ -0,0 +1,7 @@ +# Virtual Machine + +This guide outline the process of deploying to a virtual machine, e.g. AWS EC2 or DigitalOcean Droplets. + +Here we start from Ubuntu 24.04 LTS. + +TODO \ No newline at end of file diff --git a/sea-orm-pro/docs/06-deployment/02-container.md b/sea-orm-pro/docs/06-deployment/02-container.md new file mode 100644 index 0000000000..f309a14711 --- /dev/null +++ b/sea-orm-pro/docs/06-deployment/02-container.md @@ -0,0 +1,33 @@ +# Container + +This guide outline the process of building an image for deploying to containerized environments, e.g. Kubernetes. + +Here we start from Debian 12. + +```Dockerfile +FROM rust:1.81-bookworm AS build + +WORKDIR /app + +# Copy the source tree +COPY . ./ + +# Build release +RUN cargo build --release + +############################################################### + +FROM debian:bookworm-slim + +ENV RUST_LOG=info + +WORKDIR /app + +COPY --from=build /app/target/release/sea-orm-pro-backend-cli /app +COPY config /app/config +COPY pro_admin /app/pro_admin +COPY assets /app/assets +COPY db.sqlite /app + +CMD ["/app/sea-orm-pro-backend-cli", "start"] +``` \ No newline at end of file