Skip to content

Commit 4a60d8a

Browse files
committed
add podman play example
1 parent b880a8c commit 4a60d8a

10 files changed

Lines changed: 82 additions & 15 deletions

File tree

podman/podman-play-example/.env

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
POSTGRES_USER=sunnysummer1969
2+
POSTGRES_PASSWORD="aRanDomStringW1thCh#rs"
3+
POSTGRES_DB=joplin
4+
POSTGRES_PORT=5432
5+
6+
JOPLIN_SERVER_HOST_PORT=8080
7+
JOPLIN_SERVER_BASE_URL=http://localhost:8080
8+
JOPLIN_SERVER_PORT=22300
9+
JOPLIN_SERVER_DB_CLIENT=pg
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
joplin-pod-substituted.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
joplin-pod-substituted.yaml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Podman Play Kube Example
2+
3+
Docker compose alternative for Podman
4+
5+
```sh
6+
./run.sh
7+
```
8+
9+
Sever running at http://localhost:8080
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
labels:
5+
app: joplin
6+
name: joplin-pod
7+
spec:
8+
containers:
9+
- name: joplin-db
10+
image: postgres:16
11+
env:
12+
- name: POSTGRES_PASSWORD
13+
value: ${POSTGRES_PASSWORD}
14+
- name: POSTGRES_USER
15+
value: ${POSTGRES_USER}
16+
- name: POSTGRES_DB
17+
value: ${POSTGRES_DB}
18+
19+
- name: joplin-server
20+
image: joplin/server:latest
21+
env:
22+
- name: APP_PORT
23+
value: ${JOPLIN_SERVER_PORT}
24+
- name: APP_BASE_URL
25+
value: ${JOPLIN_SERVER_BASE_URL}
26+
- name: DB_CLIENT
27+
value: ${JOPLIN_SERVER_DB_CLIENT}
28+
- name: POSTGRES_PASSWORD
29+
value: ${POSTGRES_PASSWORD}
30+
- name: POSTGRES_DATABASE
31+
value: ${POSTGRES_DB}
32+
- name: POSTGRES_USER
33+
value: ${POSTGRES_USER}
34+
- name: POSTGRES_PORT
35+
value: ${POSTGRES_PORT}
36+
- name: POSTGRES_HOST
37+
value: joplin-db
38+
ports:
39+
- containerPort: ${JOPLIN_SERVER_PORT}
40+
hostPort: ${JOPLIN_SERVER_HOST_PORT}
41+
protocol: TCP

podman/podman-play-example/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export $(grep -v '^#' .env | xargs)
2+
envsubst < joplin-pod.yaml > joplin-pod-substituted.yaml
3+
podman play kube ./joplin-pod-substituted.yaml

tools/llm/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ http://localhost:3000
1010

1111
### Run the stack
1212

13+
Make sure Docker is running.
14+
1315
```
14-
podman compose up -d
16+
./start.sh
1517
```
1618

1719
## Tips & Tricks

tools/llm/docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ services:
2626
image: ghcr.io/open-webui/open-webui:main
2727
container_name: openwebui
2828
ports:
29-
- "3000:8080"
29+
- "3333:8080"
3030
volumes:
31-
- open-webui:/app/backend/data
31+
- open-webui-podman:/app/backend/data
3232
depends_on:
3333
- ollama
3434
restart: unless-stopped
@@ -42,7 +42,7 @@ services:
4242

4343
volumes:
4444
ollama:
45-
open-webui:
45+
open-webui-podman:
4646

4747
networks:
4848
openwebui:
@@ -51,8 +51,8 @@ networks:
5151

5252
offline_network:
5353
driver: bridge
54-
driver_opts:
55-
com.docker.network.bridge.enable_ip_masquerade: "${ONLINE}"
54+
# driver_opts:
55+
# com.docker.network.bridge.enable_ip_masquerade: "${ONLINE}"
5656
ipam:
5757
driver: default
5858
config:

tools/llm/start.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
export ONLINE=true
2-
DEFAULT_MODEL="tinydolphin"
2+
DEFAULT_MODEL="llama3.2:3b"
33

44
# only for podman: setup correct limits
5-
# podman machine stop
6-
# podman machine set --cpus 8 --memory 8192
7-
# podman machine start
5+
podman machine stop
86

9-
docker compose up -d
7+
8+
9+
10+
docker-compose up -d
1011
docker exec -it ollama ollama pull ${DEFAULT_MODEL}
1112

12-
docker compose down
13+
# podman compose down
1314

14-
ONLINE=false
15+
# ONLINE=false
1516

16-
docker compose up -d
17+
# podman compose up -d
1718

tools/llm/stop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export ONLINE=false
2-
docker compose down
2+
podman compose down

0 commit comments

Comments
 (0)