lemonlink/PORTAINER_DEPLOY.md

5.2 KiB

🐳 Portainer Deployment Guide

Deploy LemonLink to your Portainer Docker VM in minutes!


📋 Prerequisites

  • Portainer accessible at http://your-vm-ip:9000
  • SSH access to your Docker VM
  • Files uploaded to Gitea (✓ Done!)

Step 1: SSH into Your Docker VM

ssh root@your-docker-vm-ip

Step 2: Clone from Gitea

# Create directory
mkdir -p /opt

# Clone your repository
cd /opt
git clone https://git.lemonlink.eu/impulsivefps/lemonlink.git

# Enter directory
cd lemonlink

If Gitea requires authentication:

# Use token in URL (replace YOUR_TOKEN)
git clone https://impulsivefps:YOUR_TOKEN@git.lemonlink.eu/impulsivefps/lemonlink.git

Step 3: Verify Files

ls -la
# Should show: index.html, styles.css, script.js, docker-compose.yml, etc.

🎯 Method 2: Direct File Upload (No Git)

If you prefer not to use Git on the VM:

From Your Windows Machine:

# Using SCP (from PowerShell)
scp index.html styles.css script.js nginx.conf docker-compose.yml root@your-docker-vm-ip:/opt/lemonlink/

# Create directory first if needed:
ssh root@your-docker-vm-ip "mkdir -p /opt/lemonlink"

Or use WinSCP GUI to drag and drop files to /opt/lemonlink/.


🚀 Deploy in Portainer

Step 1: Open Portainer

  1. Go to: http://your-docker-vm-ip:9000
  2. Log in to Portainer

Step 2: Create the Stack

  1. Click Stacks in the left sidebar

  2. Click + Add Stack (or "Add stack" button)

  3. Configure:

    • Name: lemonlink
    • Build method: Select Web editor
  4. Paste this into the editor:

version: '3.8'

services:
  lemonlink:
    image: nginx:alpine
    container_name: lemonlink-landing
    restart: unless-stopped
    volumes:
      - /opt/lemonlink/index.html:/usr/share/nginx/html/index.html:ro
      - /opt/lemonlink/styles.css:/usr/share/nginx/html/styles.css:ro
      - /opt/lemonlink/script.js:/usr/share/nginx/html/script.js:ro
      - /opt/lemonlink/nginx.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - lemonlink-network
    ports:
      - "8080:80"
    healthcheck:
      test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    labels:
      - "com.lemonlink.description=LemonLink Landing Page"

networks:
  lemonlink-network:
    driver: bridge
    name: lemonlink-network
  1. Click Deploy the stack

  2. Wait for green "up" indicator (takes ~10-20 seconds)


Verify Deployment

Check in Portainer:

  1. Go to Containers
  2. Look for lemonlink-landing
  3. Status should show running (green)

Test the Website:

# From your local machine
curl http://your-docker-vm-ip:8080

Or open browser: http://your-docker-vm-ip:8080

You should see your stunning LemonLink page! 🍋


🔄 Updating After Changes

When you make changes and push to Gitea:

ssh root@your-docker-vm-ip
cd /opt/lemonlink
git pull origin master
# Changes reflect instantly - no restart needed!

Option 2: Webhook Auto-Deploy (Advanced)

Set up a webhook in Gitea to auto-deploy on push.


🔒 Adding HTTPS (Optional)

If you have Traefik or Nginx Proxy Manager:

With Traefik:

Replace the stack with:

version: '3.8'

services:
  lemonlink:
    image: nginx:alpine
    container_name: lemonlink-landing
    restart: unless-stopped
    volumes:
      - /opt/lemonlink/index.html:/usr/share/nginx/html/index.html:ro
      - /opt/lemonlink/styles.css:/usr/share/nginx/html/styles.css:ro
      - /opt/lemonlink/script.js:/usr/share/nginx/html/script.js:ro
      - /opt/lemonlink/nginx.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - traefik-public  # Your Traefik network name
    # NO PORTS - Traefik handles this
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.lemonlink.rule=Host(`lemonlink.eu`)"
      - "traefik.http.routers.lemonlink.entrypoints=websecure"
      - "traefik.http.routers.lemonlink.tls.certresolver=letsencrypt"
      - "traefik.http.services.lemonlink.loadbalancer.server.port=80"

networks:
  traefik-public:
    external: true

Then point DNS lemonlink.eu → your VM's public IP.


🛠️ Troubleshooting

Container won't start

# Check logs in Portainer:
# Containers → lemonlink-landing → Logs

# Or via SSH:
docker logs lemonlink-landing

"404 Not Found"

Check files exist:

ls -la /opt/lemonlink/
# Should show index.html, styles.css, script.js

Port already in use

Change port in the stack:

ports:
  - "8081:80"  # Use 8081 instead of 8080

Permission denied

# Fix permissions
chmod -R 755 /opt/lemonlink/

📊 Useful Portainer Commands

Action Location
View logs Containers → lemonlink-landing → Logs
Restart Containers → lemonlink-landing → Restart
Edit stack Stacks → lemonlink → Editor
Delete Stacks → lemonlink → Delete

🎉 Success!

Your stunning LemonLink landing page is now live at: http://your-docker-vm-ip:8080


Questions? Check the container logs in Portainer! 🚀