feat: configure gitea Actions deployment workflow and update droplet deployment documentation
Production Deployment / Build and Push Docker Image (push) Failing after 16s
Production Deployment / Deploy to DigitalOcean Droplet (push) Has been skipped
Production Deployment / Deploy to Google Cloud Run (push) Has been skipped

This commit is contained in:
2026-05-31 07:15:57 +05:00
parent 9d88936b4a
commit d7de80e7e0
2 changed files with 21 additions and 40 deletions
+15 -31
View File
@@ -205,46 +205,30 @@ pub async fn delete_task_handler(
## Production Deployment to a Cloud Host (DigitalOcean Droplet)
For production deployments (such as to a DigitalOcean Droplet), we avoid using `--network="host"`. Instead, we deploy both the database and the application container to a shared, user-defined Docker bridge network named **`dockernet`**. This provides secure internal DNS resolution and container isolation.
For production deployments (such as to a DigitalOcean Droplet), the application is fully containerized and configured via standard environment variables.
### 1. Create the Isolated Docker Network
On your Droplet, create the bridge network:
The application is completely decoupled from the underlying hosting, networking, and database infrastructure. You are responsible for provisioning the database and supplying the connection configuration.
### 1. Build the Application Container
Build the application Docker image:
```bash
docker network create dockernet
```
### 2. Build and Run the Database Infrastructure
Build the custom MongoDB infrastructure image using the dedicated `Infra.DockerFile`:
```bash
# 1. Build the database image
docker build -t stick-db -f Infra.DockerFile .
# 2. Run the database container on 'dockernet' with host persistence
docker run --name stick-mongodb \
--network dockernet \
-v /var/lib/mongodb/data:/data/db \
-d \
stick-db
```
*Note: The database container is named `stick-mongodb`. Other containers on `dockernet` can now resolve this container using `mongodb://stick-mongodb:27017`.*
### 3. Build and Deploy the Application Container
Build the main application image and launch it on the same network:
```bash
# 1. Build the application image
docker build -t stick-app .
```
# 2. Run the application container, linking to the database using its container name
docker run --name stick-app-container \
--network dockernet \
### 2. Deploy the Application Container
Run the container on your target Docker network, providing the connection details to your pre-existing MongoDB database container through environment variables:
```bash
docker run -d \
--name stick-app-container \
--network your-docker-network \
-p 80:3007 \
-e DATABASE_URL="mongodb://stick-mongodb:27017" \
-e DATABASE_URL="mongodb://your-mongodb-host:27017" \
-e DATABASE_NAME="stick_db" \
-e JWT_SECRET="your_secure_production_jwt_signing_key_at_least_32_chars_long" \
-e HOST="0.0.0.0" \
-e PORT="3007" \
-d \
--restart unless-stopped \
stick-app
```
*Note: `-p 80:3007` maps the Droplet's external HTTP port 80 to the application's internal container port 3007.*
*Note: Adjust the port mapping (`-p`), container name, network name, and `DATABASE_URL` environment variable as necessary to integrate with your custom proxy or container infrastructure.*