Skip to content

Commit ff52fe4

Browse files
feat: change port to support rootless feat: (breaking) change localhost
url and port to support rootless feat: support podman socket docs: add container runtime details
1 parent 8913c08 commit ff52fe4

File tree

8 files changed

+187
-18
lines changed

8 files changed

+187
-18
lines changed

backend/sample.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DEFAULT_LOG_LEVEL="INFO"
1111
PATH_PREFIX="api/v1"
1212

1313
# Django settings
14-
DJANGO_APP_BACKEND_URL=http://frontend.unstract.localhost
14+
DJANGO_APP_BACKEND_URL=http://frontend.unstract.localhost:8081
1515
DJANGO_SECRET_KEY="1(xf&nc6!y7!l&!5xe&i_rx7e^m@fcut9fduv86ft=-b@2g6"
1616

1717
# Postgres DB envs
@@ -40,7 +40,7 @@ GOOGLE_OAUTH2_SECRET=
4040
SESSION_EXPIRATION_TIME_IN_SECOND=7200
4141

4242
# FE Web Application Dependencies
43-
WEB_APP_ORIGIN_URL="http://frontend.unstract.localhost"
43+
WEB_APP_ORIGIN_URL="http://frontend.unstract.localhost:8081"
4444

4545
# API keys for trusted services
4646
INTERNAL_SERVICE_API_KEY=

docker/CONTAINER_RUNTIME.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Container Runtime Support (Docker & Podman)
2+
3+
The Unstract docker-compose configuration supports both **Docker** and **Podman** automatically.
4+
5+
## Automatic Detection
6+
7+
By default, the configuration will automatically detect and use the appropriate socket:
8+
- **Podman rootless**: `/run/user/$UID/podman/podman.sock`
9+
- **Docker**: `/var/run/docker.sock`
10+
11+
## Using Docker
12+
13+
Just run docker-compose commands normally:
14+
15+
```bash
16+
VERSION=main docker-compose -f docker-compose.yaml up -d
17+
```
18+
19+
No environment variables needed - Docker socket at `/var/run/docker.sock` will be used automatically.
20+
21+
## Using Podman
22+
23+
### Prerequisites
24+
25+
1. **Enable Podman socket** (required for Traefik to discover containers):
26+
```bash
27+
systemctl --user enable podman.socket
28+
systemctl --user start podman.socket
29+
```
30+
31+
2. **Verify socket is running**:
32+
```bash
33+
systemctl --user status podman.socket
34+
# Should show: active (listening)
35+
```
36+
37+
### Run with Podman
38+
39+
```bash
40+
VERSION=main podman-compose -f docker-compose.yaml up -d
41+
```
42+
43+
The Podman socket will be automatically detected via `$XDG_RUNTIME_DIR/podman/podman.sock`.
44+
45+
## Manual Override
46+
47+
If you need to specify a custom socket path, set the `DOCKER_SOCKET` environment variable:
48+
49+
```bash
50+
# Example: Custom Docker socket location
51+
export DOCKER_SOCKET=/custom/path/docker.sock
52+
VERSION=main docker-compose -f docker-compose.yaml up -d
53+
54+
# Example: Custom Podman socket location
55+
export DOCKER_SOCKET=/run/user/$(id -u)/podman/podman.sock
56+
VERSION=main podman-compose -f docker-compose.yaml up -d
57+
```
58+
59+
## Troubleshooting
60+
61+
### Traefik shows "Cannot connect to Docker daemon"
62+
63+
**For Podman users**:
64+
1. Check if Podman socket is running:
65+
```bash
66+
systemctl --user status podman.socket
67+
```
68+
69+
2. If inactive, start it:
70+
```bash
71+
systemctl --user start podman.socket
72+
```
73+
74+
3. Verify socket file exists:
75+
```bash
76+
ls -la $XDG_RUNTIME_DIR/podman/podman.sock
77+
# Should show: srw-rw---- (socket file, not directory)
78+
```
79+
80+
4. If it's a directory (wrong), remove and restart:
81+
```bash
82+
rmdir $XDG_RUNTIME_DIR/podman/podman.sock
83+
systemctl --user restart podman.socket
84+
```
85+
86+
**For Docker users**:
87+
1. Check if Docker daemon is running:
88+
```bash
89+
systemctl status docker
90+
```
91+
92+
2. Verify socket permissions:
93+
```bash
94+
ls -la /var/run/docker.sock
95+
```
96+
97+
### Port 8081 not accessible
98+
99+
This is the Traefik HTTP port for Podman rootless compatibility.
100+
101+
1. Check if Traefik container is running:
102+
```bash
103+
podman ps | grep unstract-proxy
104+
# or
105+
docker ps | grep unstract-proxy
106+
```
107+
108+
2. Check Traefik logs:
109+
```bash
110+
podman logs unstract-proxy
111+
# or
112+
docker logs unstract-proxy
113+
```
114+
115+
## Socket Path Priority
116+
117+
The configuration uses this priority order:
118+
119+
1. `$DOCKER_SOCKET` - if explicitly set
120+
2. `$XDG_RUNTIME_DIR/podman/podman.sock` - for Podman rootless
121+
3. `/run/user/1000/podman/podman.sock` - fallback for Podman
122+
4. Falls back to default compose behavior (typically `/var/run/docker.sock`)
123+
124+
## Technical Details
125+
126+
The docker-compose files use this volume mount configuration:
127+
128+
```yaml
129+
volumes:
130+
- ${DOCKER_SOCKET:-${XDG_RUNTIME_DIR:-/run/user/1000}/podman/podman.sock}:/var/run/docker.sock
131+
```
132+
133+
This means:
134+
- If `DOCKER_SOCKET` is set → use that
135+
- Else if `XDG_RUNTIME_DIR` is set → use `$XDG_RUNTIME_DIR/podman/podman.sock`
136+
- Else → use `/run/user/1000/podman/podman.sock`
137+
138+
For Docker, you can set:
139+
```bash
140+
export DOCKER_SOCKET=/var/run/docker.sock
141+
```
142+
143+
But it's usually not necessary since Docker Compose will use `/var/run/docker.sock` by default when the variable is unset.

docker/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Docker Commands
22

3+
## Container Runtime Support
4+
5+
This project supports both **Docker** and **Podman**. See [CONTAINER_RUNTIME.md](CONTAINER_RUNTIME.md) for detailed information.
6+
7+
**Quick Start**:
8+
- **Docker**: Use `docker compose` commands as shown below
9+
- **Podman**: Use `podman-compose` commands AND enable the socket: `systemctl --user enable --now podman.socket`
10+
311
## Docker Build
412

513
```bash

docker/docker-compose-dev-essentials.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ services:
7777
--providers.docker=true --providers.docker.network=unstract-network
7878
--providers.file.filename=/proxy_overrides.yaml --providers.file.watch=true
7979
ports:
80-
# The HTTP port
81-
- "80:80"
80+
# The HTTP port (changed to 8081 for rootless Podman compatibility)
81+
- "8081:80"
8282
# The Web UI (enabled by --api.insecure=true)
8383
- "8080:8080"
8484
volumes:
85-
# So that Traefik can listen to the Docker events
86-
- /var/run/docker.sock:/var/run/docker.sock
85+
# Universal socket mount - works with both Docker and Podman
86+
# Podman rootless: /run/user/$UID/podman/podman.sock
87+
# Docker: /var/run/docker.sock
88+
- ${DOCKER_SOCKET:-${XDG_RUNTIME_DIR:-/run/user/1000}/podman/podman.sock}:/var/run/docker.sock
8789
# Proxy overrides for components run directly in Docker host
8890
- ./proxy_overrides.yaml:/proxy_overrides.yaml
8991
# Since any proxy overrides need to point to Docker host for relevant routes.
@@ -142,8 +144,8 @@ services:
142144
env_file:
143145
- ./essentials.env
144146
ports:
145-
- "5672:5672" # AMQP port
146-
- "15672:15672" # Management UI port
147+
- "5672:5672" # AMQP port
148+
- "15672:15672" # Management UI port
147149
volumes:
148150
- rabbitmq_data:/var/lib/rabbitmq
149151

docker/docker-compose.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ services:
5757
- ./workflow_data:/data
5858
- ${TOOL_REGISTRY_CONFIG_SRC_PATH}:/data/tool_registry_config
5959

60-
6160
# Celery worker for managing logs and periodic tasks
6261
worker-logging:
6362
image: unstract/backend:${VERSION}
@@ -153,8 +152,8 @@ services:
153152
- ../backend/.env
154153
- ./essentials.env
155154
depends_on:
156-
- db
157-
- rabbitmq
155+
- db
156+
- rabbitmq
158157
environment:
159158
- ENVIRONMENT=development
160159
- APPLICATION_NAME=unstract-celery-beat
@@ -165,7 +164,7 @@ services:
165164
container_name: unstract-frontend
166165
restart: unless-stopped
167166
ports:
168-
- "3000:80"
167+
- "3000:8080"
169168
depends_on:
170169
- backend
171170
- reverse-proxy
@@ -174,6 +173,7 @@ services:
174173
labels:
175174
- traefik.enable=true
176175
- traefik.http.routers.frontend.rule=Host(`frontend.unstract.localhost`) && !PathPrefix(`/api/v1`, `/deployment`)
176+
- traefik.http.services.frontend.loadbalancer.server.port=8080
177177

178178
platform-service:
179179
image: unstract/platform-service:${VERSION}
@@ -231,8 +231,10 @@ services:
231231
- ../runner/.env
232232
volumes:
233233
- ./workflow_data:/data
234-
# Docker socket bind mount to spawn tool containers
235-
- /var/run/docker.sock:/var/run/docker.sock
234+
# Universal socket mount - works with both Docker and Podman
235+
# Podman rootless: /run/user/$UID/podman/podman.sock
236+
# Docker: /var/run/docker.sock
237+
- ${DOCKER_SOCKET:-${XDG_RUNTIME_DIR:-/run/user/1000}/podman/podman.sock}:/var/run/docker.sock
236238
depends_on:
237239
- redis
238240
- rabbitmq
@@ -310,7 +312,21 @@ services:
310312
container_name: unstract-worker-file-processing-v2
311313
restart: unless-stopped
312314
# command: ["file-processing"]
313-
command: [".venv/bin/celery", "-A", "worker", "worker", "--queues=file_processing,api_file_processing,file_processing_priority", "--loglevel=INFO", "--pool=prefork", "--concurrency=4", "--prefetch-multiplier=1", "--without-gossip", "--without-mingle", "--without-heartbeat"]
315+
command:
316+
[
317+
".venv/bin/celery",
318+
"-A",
319+
"worker",
320+
"worker",
321+
"--queues=file_processing,api_file_processing,file_processing_priority",
322+
"--loglevel=INFO",
323+
"--pool=prefork",
324+
"--concurrency=4",
325+
"--prefetch-multiplier=1",
326+
"--without-gossip",
327+
"--without-mingle",
328+
"--without-heartbeat",
329+
]
314330
ports:
315331
- "8087:8082"
316332
env_file:

docker/dockerfiles/frontend.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ RUN mkdir -p /usr/share/nginx/html/config && \
5454
COPY ../frontend/generate-runtime-config.sh /docker-entrypoint.d/40-env.sh
5555
RUN chmod +x /docker-entrypoint.d/40-env.sh
5656

57-
EXPOSE 80
57+
EXPOSE 8080
5858

5959
USER nginx
6060

frontend/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ http {
3838
scgi_temp_path /tmp/scgi_temp 1 2;
3939

4040
server {
41-
listen 80;
41+
listen 8080;
4242
root /usr/share/nginx/html;
4343
include /etc/nginx/mime.types;
4444

frontend/sample.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REACT_APP_BACKEND_URL=http://localhost:8000
1+
REACT_APP_BACKEND_URL=http://frontend.unstract.localhost:8081
22

33
# For development
44
NODE_ENV=development

0 commit comments

Comments
 (0)