Skip to content

fix: Imgproxy container exposure#740

Open
vladyslavprosolupov wants to merge 1 commit intoDokploy:canaryfrom
vladyslavprosolupov:canary
Open

fix: Imgproxy container exposure#740
vladyslavprosolupov wants to merge 1 commit intoDokploy:canaryfrom
vladyslavprosolupov:canary

Conversation

@vladyslavprosolupov
Copy link
Copy Markdown
Contributor

@vladyslavprosolupov vladyslavprosolupov commented Mar 9, 2026

What is this PR about?

@Siumauricio On fresh dokploy installation imgproxy container exposure was needed. Unfortunately, my previous implementation doesn't work as expected without direct expose in docker-compose.yml.

Checklist

Before submitting this PR, please make sure that:

Greptile Summary

This PR fixes container-to-container communication for the imgproxy blueprint by adding an explicit expose: - 8080 directive to the imgproxy service in docker-compose.yml. On fresh Dokploy installations, the platform relies on the expose declaration to wire up internal service routing, so without it nginx could not reach imgproxy on port 8080.

  • The change is minimal and correct — it mirrors the existing expose: - 80 pattern already present on the nginx service.
  • Port 8080 is imgproxy's default listen port and is already referenced in the nginx proxy_pass http://imgproxy:8080 directive, so this is a consistent fix.
  • Uses expose (not ports), which is the required convention for this repository per the Docker Compose guidelines.

Confidence Score: 5/5

  • This PR is safe to merge — it makes a single, minimal, and correct change that aligns with both Docker Compose conventions and the repository's own guidelines.
  • The change adds a single expose: - 8080 directive that is already the established pattern for this repository (nginx already has expose: - 80), targets the correct default imgproxy port, does not introduce ports or any other prohibited directive, and directly resolves the reported deployment issue on fresh Dokploy installations.
  • No files require special attention.

Last reviewed commit: 8d7fb61

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

Context used:

  • Rule used - AGENTS.md (source)

Copilot AI review requested due to automatic review settings March 9, 2026 11:24
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
templates ✅ Ready (View Log) Visit Preview 8d7fb61

@dosubot dosubot bot added the bug Something isn't working label Mar 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the imgproxy Dokploy template to explicitly declare the container’s internal listening port in Compose, addressing a deployment issue where imgproxy wasn’t reachable as expected on fresh Dokploy installs.

Changes:

  • Add expose: 8080 to the imgproxy service so its internal port is explicitly declared in docker-compose.yml.

@dosubot
Copy link
Copy Markdown

dosubot bot commented Mar 9, 2026

Related Documentation

2 document(s) may need updating based on files changed in this PR:

Dokploy's Space

AGENTS /templates/blob/canary/AGENTS.md
View Suggested Changes
@@ -147,9 +147,13 @@
 - **Docker Compose Conventions (CRITICAL):**
 
   - **Version:** MUST be `3.8`
-  - **NEVER include:** `ports` (use `expose` only), `container_name`, `networks` (Dokploy handles isolation)
-  - **ALWAYS include:** `restart: unless-stopped` or `restart: always`, persistent volumes
+  - **NEVER include:** `ports` (Dokploy handles port mapping), `container_name`, `networks` (Dokploy handles isolation)
+  - **ALWAYS include:** 
+    - `expose` directive listing all ports the service listens on (REQUIRED for Dokploy to route traffic correctly)
+    - `restart: unless-stopped` or `restart: always`
+    - Persistent volumes for data that should survive container restarts
   - **Service naming:** MUST match blueprint folder name exactly
+  - **Port exposure:** Services MUST explicitly declare exposed ports using `expose`, even without host port mappings. Omitting `expose` can cause containers to be unreachable by Dokploy's routing layer.
   - **Example:**
     ```yaml
     version: "3.8"
@@ -157,6 +161,8 @@
       ghost:
         image: ghost:6-alpine
         restart: always
+        expose:
+          - 2368
         volumes:
           - ghost:/var/lib/ghost/content
     volumes:
@@ -220,3 +226,4 @@
   4. Using object syntax for env vars in template.toml (must be array of strings)
   5. Logo file missing or filename mismatch in meta.json
   6. Version mismatch between meta.json and docker-compose.yml image tag
+  7. Omitting `expose` directive in docker-compose.yml (causes containers to be unreachable)

[Accept] [Decline]

copilot-instructions /templates/blob/canary/.github/copilot-instructions.md
View Suggested Changes
@@ -50,7 +50,7 @@
 - **Open Source Requirement**: **ALL services MUST be open source**. Only applications with open-source licenses (MIT, Apache, GPL, AGPL, etc.) are allowed. Proprietary or closed-source services are strictly prohibited.
 - **Template IDs**: Lowercase, kebab-case (e.g., `active-pieces`); unique across repo—enforced by dedupe script.
 - **Docker Compose**: 
-  - **Port Mappings**: **NEVER use `ports` with host port mappings** (e.g., `"8080:8080"`)—**always use `expose` only** (e.g., `expose: ["8080"]`). Dokploy handles port proxying via its internal reverse proxy, so host port bindings are unnecessary and create potential port conflicts. This applies to ALL blueprints; some older templates may still incorrectly use `ports` and should be updated to use `expose` instead.
+  - **Port Mappings**: **NEVER use `ports` with host port mappings** (e.g., `"8080:8080"`)—**MUST use explicit `expose` directives** (e.g., `expose: ["8080"]`). Simply omitting `ports` is not sufficient; services MUST explicitly declare which ports they expose for Dokploy to properly route traffic to them. Without explicit `expose` directives, containers may be unreachable (see imgproxy fix in PR #740 where adding `expose: [8080]` resolved container accessibility issues). Dokploy handles port proxying via its internal reverse proxy, so host port bindings are unnecessary and create potential port conflicts. This applies to ALL blueprints; some older templates may still incorrectly use `ports` and should be updated to use `expose` instead.
   - Use persistent volumes for data storage (e.g., `- db-data:/var/lib/postgresql/data`). 
   - Services named after folder (e.g., `ghost` service).
 - **template.toml**:

[Accept] [Decline]

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?  Join Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants