add portainer
This commit is contained in:
@@ -6,6 +6,7 @@ Three Docker environments are available:
|
||||
- `Dockerfile.test` with `docker-compose.test.yml`
|
||||
- `Dockerfile.production` with `docker-compose.production.yml`
|
||||
- `docker-compose.pgmanage.yml` for a standalone pgManage container
|
||||
- `docker-compose.portainer.production.yml` for a standalone production Portainer deployment behind Traefik
|
||||
|
||||
### Development
|
||||
|
||||
@@ -118,6 +119,7 @@ Add an A record for every subdomain to your server's public IP before deploying
|
||||
| `rentaldrivego.ma` | marketplace and public site |
|
||||
| `api.rentaldrivego.ma` | API |
|
||||
| `pgmanage.rentaldrivego.ma` | pgManage (DB admin) |
|
||||
| `portainer.rentaldrivego.ma` | Portainer |
|
||||
|
||||
#### 2. Install Docker and clone the repo
|
||||
|
||||
@@ -155,6 +157,7 @@ Open `.env.docker.production` and fill in every value. The minimum required secr
|
||||
Production now derives `DATABASE_URL` inside the app container from `POSTGRES_HOST`, `POSTGRES_PORT`, `POSTGRES_DB`, `POSTGRES_USER`, and `POSTGRES_PASSWORD` when `DATABASE_URL_FROM_POSTGRES=true`. That avoids Prisma auth failures when the database password contains reserved URL characters such as `@`, `:`, or `/`.
|
||||
|
||||
The example file uses `rentaldrivego.ma` for the marketplace and public site. The dashboard and admin panel are routed under that same host at `/dashboard` and `/admin`.
|
||||
Set `PORTAINER_DOMAIN=portainer.rentaldrivego.ma` in `.env.docker.production` to expose Portainer through Traefik.
|
||||
|
||||
#### 4a. Configure the registry for CI deploys
|
||||
|
||||
@@ -202,6 +205,7 @@ npm run docker:prod:start:dashboard
|
||||
npm run docker:prod:start:admin
|
||||
npm run docker:prod:start:frontends
|
||||
npm run docker:prod:start:pgmanage
|
||||
npm run docker:prod:start:portainer
|
||||
npm run docker:prod:start:all
|
||||
```
|
||||
|
||||
@@ -211,6 +215,20 @@ Docker will:
|
||||
|
||||
Traefik automatically picks up the containers and provisions TLS certificates. Services are live at their `https://` URLs within ~30 seconds.
|
||||
|
||||
#### 6a. Deploy Portainer
|
||||
|
||||
Portainer is deployed separately from the main app stack and reuses the shared `traefik-proxy` network managed by Traefik.
|
||||
|
||||
```bash
|
||||
npm run docker:prod:start:portainer
|
||||
```
|
||||
|
||||
Equivalent raw Docker Compose command:
|
||||
|
||||
```bash
|
||||
docker compose -p rentaldrivego-portainer-prod --env-file .env.docker.production -f docker-compose.portainer.production.yml up -d
|
||||
```
|
||||
|
||||
Uploaded assets handled by the API, including vehicle photos and company branding images, are persisted in the named Docker volume `api_uploads`, mounted inside the API container at `/var/lib/rentaldrivego/storage`. Rebuilding or redeploying the API no longer clears those files as long as that volume is kept.
|
||||
|
||||
#### Updating after a code change
|
||||
@@ -345,6 +363,16 @@ pgManage is available at `https://pgmanage.rentaldrivego.ma`. To connect to the
|
||||
- **Username:** `postgres`
|
||||
- **Password:** value of `POSTGRES_PASSWORD` from `.env.docker.production`
|
||||
|
||||
#### Portainer
|
||||
|
||||
Portainer is available at `https://portainer.rentaldrivego.ma`.
|
||||
|
||||
Use this command to deploy or update it:
|
||||
|
||||
```bash
|
||||
npm run docker:prod:start:portainer
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
- The production image builds the whole monorepo once, then each service overrides its runtime command.
|
||||
|
||||
Reference in New Issue
Block a user