- Enhance lexical editor with formatting options (strikethrough, inline code, subscript, superscript), lists (unordered, ordered, checklist), tables, alignment, indentation, blockquotes, horizontal rules, uploads, and relationships - Update Dockerfile for improved build process, including .npmrc support, pnpm config, telemetry disable, and production optimizations - Modify CI workflow to deploy only, removing local build steps and updating webhook trigger - Add .dockerignore file and deployment documentation for Docker build and push workflow - Configure Next.js for standalone output in next.config.js BREAKING CHANGE: CI workflow now requires local Docker builds before pushing code, as automated builds have been removed.
2.8 KiB
description
| description |
|---|
| Build Docker image and push to Docker Hub for Coolify deployment |
Docker Build and Push Workflow
This workflow builds a Docker image locally and pushes it to Docker Hub so it can be deployed to Coolify.
Prerequisites
- Docker Hub Account: Make sure you have a Docker Hub account
- Docker Hub Login: Log in to Docker Hub from your terminal
docker login
Enter your Docker Hub username and password when prompted.
Workflow Steps
1. Build the Docker Image
Build your Docker image with a tag that includes your Docker Hub username:
docker build -t YOUR_DOCKERHUB_USERNAME/website-ricenoodletw-cms:latest .
Replace YOUR_DOCKERHUB_USERNAME with your actual Docker Hub username.
You can also add a specific version tag:
docker build -t YOUR_DOCKERHUB_USERNAME/website-ricenoodletw-cms:v1.0.0 .
2. (Optional) Test the Image Locally
Before pushing, you can test the image locally:
docker run -p 3000:3000 YOUR_DOCKERHUB_USERNAME/website-ricenoodletw-cms:latest
3. Push to Docker Hub
Push the image to Docker Hub:
docker push YOUR_DOCKERHUB_USERNAME/website-ricenoodletw-cms:latest
If you tagged a specific version, push that too:
docker push YOUR_DOCKERHUB_USERNAME/website-ricenoodletw-cms:v1.0.0
4. Deploy to Coolify
In your Coolify dashboard:
- Create a new service or edit your existing service
- Select Docker Image as the source
- Enter your image name:
YOUR_DOCKERHUB_USERNAME/website-ricenoodletw-cms:latest - Configure environment variables if needed
- Deploy
Coolify will pull the image from Docker Hub and deploy it.
Automated Deployment with Gitea Actions
Since building happens locally, the Gitea workflow only triggers Coolify deployment. Here's a sample workflow for .gitea/workflows/deploy.yaml:
name: Deploy to Coolify
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Trigger Coolify Deployment
run: |
curl -X POST "${{ secrets.COOLIFY_WEBHOOK_URL }}"
Setup Instructions:
-
Get Coolify Webhook URL:
- In Coolify, go to your service settings
- Find the "Webhooks" section
- Copy the webhook URL
-
Add to Gitea Secrets:
- Go to your repository in Gitea
- Navigate to Settings → Secrets
- Add
COOLIFY_WEBHOOK_URLwith the webhook URL from Coolify
Workflow:
- Build and push locally (steps 1-3 above)
- Push code to Gitea - This triggers the Gitea workflow
- Gitea notifies Coolify - Coolify pulls the latest image from Docker Hub
- Coolify redeploys - Your service is updated with the new image
Note: Make sure your Coolify service is configured to use the Docker image from Docker Hub (YOUR_DOCKERHUB_USERNAME/website-ricenoodletw-cms:latest).