3.9 KiB
3.9 KiB
Coolify Deployment Guide
This guide explains how to deploy the Linux Service website to your self-hosted Coolify instance with automatic updates from your Gitea repository.
Prerequisites
- Coolify installed and running
- Access to your Gitea instance (gitea.boner.be)
- Domain name configured for your service
Environment Variables
The application supports the following environment variables:
Variable | Default Value | Description |
---|---|---|
PORT |
8080 |
Port the application listens on |
COMPANY_NAME |
Hogeland Linux |
Company name displayed on the website |
KVK |
12345678 |
KVK number for contact information |
EMAIL |
info@hogelandlinux.nl |
Contact email address |
PHONE |
+31 6 12345678 |
Contact phone number |
Coolify Deployment Steps
1. Create New Resource in Coolify
- Open your Coolify dashboard
- Click "New Resource"
- Select "Public Repository" or "Private Repository" (if your Gitea repo is private)
2. Configure Repository
Repository URL: https://gitea.boner.be/[your-username]/[repository-name]
Branch: master
Build Pack: Docker
3. Configure Build Settings
- Dockerfile Location:
./Dockerfile
- Build Context:
.
- Ports:
8080
4. Set Environment Variables
In the Coolify environment variables section, add:
PORT=8080
COMPANY_NAME=Hogeland Linux
KVK=12345678
EMAIL=info@hogelandlinux.nl
PHONE=+31 6 12345678
5. Configure Domain
- Set your desired domain/subdomain
- Coolify will automatically handle SSL certificate generation
6. Enable Auto-Deploy
- Go to the "Settings" tab of your application
- Enable "Auto Deploy"
- Set the branch to
master
- Configure webhook URL in your Gitea repository
7. Gitea Webhook Configuration
To enable automatic deployments when you push to master:
- Go to your repository on gitea.boner.be
- Navigate to Settings → Webhooks
- Click "Add Webhook" → "Gitea"
- Set the Payload URL to your Coolify webhook URL (found in your app settings)
- Set Content Type to
application/json
- Select "Just the push event"
- Check "Active"
- Click "Add Webhook"
Docker Commands for Local Testing
# Build the image
docker build -t linuxservice .
# Run locally
docker run -p 8080:8080 \
-e COMPANY_NAME="Hogeland Linux" \
-e EMAIL="info@hogelandlinux.nl" \
linuxservice
# Or use docker-compose
docker-compose up --build
Troubleshooting
Common Issues
- Build Fails: Check that all files (templates/, static/) are committed to your repository
- Port Issues: Ensure PORT environment variable matches the exposed port
- Template Errors: Verify that templates directory is included in the Docker image
Logs
Check application logs in Coolify dashboard under the "Logs" tab.
Health Check
The application should respond to GET /
with the homepage. You can check this endpoint to verify the deployment.
File Structure
linuxservice/
├── Dockerfile # Container configuration
├── docker-compose.yml # Local development
├── .dockerignore # Docker build optimization
├── main.go # Go application
├── go.mod # Go module definition
├── static/ # Static assets (CSS, images, etc.)
│ └── style.css
├── templates/ # HTML templates
│ ├── index.html
│ └── contact.html
└── DEPLOYMENT.md # This file
Performance Considerations
- The Docker image uses multi-stage builds for smaller size
- Static files are served directly by the Go application
- No external dependencies required
- Minimal resource usage (suitable for small VPS instances)
Security Notes
- The application runs as a non-root user in the container
- Only port 8080 is exposed
- No sensitive data is stored in the application
- Environment variables should be used for configuration