Skip to content

Commit 563e7a2

Browse files
committed
fix: docker-compose for temporal
1 parent d7a92e0 commit 563e7a2

File tree

4 files changed

+283
-7
lines changed

4 files changed

+283
-7
lines changed

Dockerfile.dev

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
FROM node:22.20-alpine
1+
FROM node:22.20-bookworm-slim
22
ARG NEXT_PUBLIC_VERSION
33
ENV NEXT_PUBLIC_VERSION=$NEXT_PUBLIC_VERSION
4-
RUN apk add --no-cache g++ make py3-pip bash nginx
5-
RUN adduser -D -g 'www' www
6-
RUN mkdir /www
7-
RUN chown -R www:www /var/lib/nginx
8-
RUN chown -R www:www /www
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
g++ \
6+
make \
7+
python3-pip \
8+
bash \
9+
nginx \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
RUN addgroup --system www \
13+
&& adduser --system --ingroup www --home /www --shell /usr/sbin/nologin www \
14+
&& mkdir -p /www \
15+
&& chown -R www:www /www /var/lib/nginx
916

1017

1118
RUN npm --no-update-notifier --no-fund --global install pnpm@10.6.1 pm2

docker-compose.dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
POSTGRES_PASSWORD: postiz-local-pwd
1313
POSTGRES_USER: postiz-local
1414
POSTGRES_DB: postiz-db-local
15+
TEMPORAL_ADDRESS: "temporal:7233"
1516
volumes:
1617
- postgres-volume:/var/lib/postgresql/data
1718
ports:

docker-compose.yaml

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
services:
2+
postiz:
3+
image: ghcr.io/gitroomhq/postiz-app:latest
4+
container_name: postiz
5+
restart: always
6+
environment:
7+
# === Required Settings
8+
MAIN_URL: 'http://localhost:4007'
9+
FRONTEND_URL: 'http://localhost:4007'
10+
NEXT_PUBLIC_BACKEND_URL: 'http://localhost:4007/api'
11+
JWT_SECRET: 'random string that is unique to every install - just type random characters here!'
12+
DATABASE_URL: 'postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local'
13+
REDIS_URL: 'redis://postiz-redis:6379'
14+
BACKEND_INTERNAL_URL: 'http://localhost:3000'
15+
TEMPORAL_ADDRESS: "temporal:7233"
16+
IS_GENERAL: 'true'
17+
DISABLE_REGISTRATION: 'false'
18+
19+
# === Storage Settings
20+
STORAGE_PROVIDER: 'local'
21+
UPLOAD_DIRECTORY: '/uploads'
22+
NEXT_PUBLIC_UPLOAD_DIRECTORY: '/uploads'
23+
24+
# === Cloudflare (R2) Settings
25+
# STORAGE_PROVIDER: 'cloudflare'
26+
# CLOUDFLARE_ACCOUNT_ID: 'your-account-id'
27+
# CLOUDFLARE_ACCESS_KEY: 'your-access-key'
28+
# CLOUDFLARE_SECRET_ACCESS_KEY: 'your-secret-access-key'
29+
# CLOUDFLARE_BUCKETNAME: 'your-bucket-name'
30+
# CLOUDFLARE_BUCKET_URL: 'https://your-bucket-url.r2.cloudflarestorage.com/'
31+
# CLOUDFLARE_REGION: 'auto'
32+
33+
# === Social Media API Settings
34+
X_API_KEY: ''
35+
X_API_SECRET: ''
36+
LINKEDIN_CLIENT_ID: ''
37+
LINKEDIN_CLIENT_SECRET: ''
38+
REDDIT_CLIENT_ID: ''
39+
REDDIT_CLIENT_SECRET: ''
40+
GITHUB_CLIENT_ID: ''
41+
GITHUB_CLIENT_SECRET: ''
42+
BEEHIIVE_API_KEY: ''
43+
BEEHIIVE_PUBLICATION_ID: ''
44+
THREADS_APP_ID: ''
45+
THREADS_APP_SECRET: ''
46+
FACEBOOK_APP_ID: ''
47+
FACEBOOK_APP_SECRET: ''
48+
YOUTUBE_CLIENT_ID: ''
49+
YOUTUBE_CLIENT_SECRET: ''
50+
TIKTOK_CLIENT_ID: ''
51+
TIKTOK_CLIENT_SECRET: ''
52+
PINTEREST_CLIENT_ID: ''
53+
PINTEREST_CLIENT_SECRET: ''
54+
DRIBBBLE_CLIENT_ID: ''
55+
DRIBBBLE_CLIENT_SECRET: ''
56+
DISCORD_CLIENT_ID: ''
57+
DISCORD_CLIENT_SECRET: ''
58+
DISCORD_BOT_TOKEN_ID: ''
59+
SLACK_ID: ''
60+
SLACK_SECRET: ''
61+
SLACK_SIGNING_SECRET: ''
62+
MASTODON_URL: 'https://mastodon.social'
63+
MASTODON_CLIENT_ID: ''
64+
MASTODON_CLIENT_SECRET: ''
65+
66+
# === OAuth & Authentik Settings
67+
# NEXT_PUBLIC_POSTIZ_OAUTH_DISPLAY_NAME: 'Authentik'
68+
# NEXT_PUBLIC_POSTIZ_OAUTH_LOGO_URL: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/master/png/authentik.png'
69+
# POSTIZ_GENERIC_OAUTH: 'false'
70+
# POSTIZ_OAUTH_URL: 'https://auth.example.com'
71+
# POSTIZ_OAUTH_AUTH_URL: 'https://auth.example.com/application/o/authorize'
72+
# POSTIZ_OAUTH_TOKEN_URL: 'https://auth.example.com/application/o/token'
73+
# POSTIZ_OAUTH_USERINFO_URL: 'https://authentik.example.com/application/o/userinfo'
74+
# POSTIZ_OAUTH_CLIENT_ID: ''
75+
# POSTIZ_OAUTH_CLIENT_SECRET: ''
76+
# POSTIZ_OAUTH_SCOPE: "openid profile email" # Optional: uncomment to override default scope
77+
78+
# === Sentry
79+
80+
# NEXT_PUBLIC_SENTRY_DSN: 'http://spotlight:8969/stream'
81+
# SENTRY_SPOTLIGHT: '1'
82+
83+
# === Misc Settings
84+
OPENAI_API_KEY: ''
85+
NEXT_PUBLIC_DISCORD_SUPPORT: ''
86+
NEXT_PUBLIC_POLOTNO: ''
87+
API_LIMIT: 30
88+
89+
# === Payment / Stripe Settings
90+
FEE_AMOUNT: 0.05
91+
STRIPE_PUBLISHABLE_KEY: ''
92+
STRIPE_SECRET_KEY: ''
93+
STRIPE_SIGNING_KEY: ''
94+
STRIPE_SIGNING_KEY_CONNECT: ''
95+
96+
# === Developer Settings
97+
NX_ADD_PLUGINS: false
98+
99+
# === Short Link Service Settings (Optional - leave blank if unused)
100+
# DUB_TOKEN: ""
101+
# DUB_API_ENDPOINT: "https://api.dub.co"
102+
# DUB_SHORT_LINK_DOMAIN: "dub.sh"
103+
# SHORT_IO_SECRET_KEY: ""
104+
# KUTT_API_KEY: ""
105+
# KUTT_API_ENDPOINT: "https://kutt.it/api/v2"
106+
# KUTT_SHORT_LINK_DOMAIN: "kutt.it"
107+
# LINK_DRIP_API_KEY: ""
108+
# LINK_DRIP_API_ENDPOINT: "https://api.linkdrip.com/v1/"
109+
# LINK_DRIP_SHORT_LINK_DOMAIN: "dripl.ink"
110+
111+
volumes:
112+
- postiz-config:/config/
113+
- postiz-uploads:/uploads/
114+
ports:
115+
- "4007:5000"
116+
networks:
117+
- postiz-network
118+
- temporal-network
119+
depends_on:
120+
postiz-postgres:
121+
condition: service_healthy
122+
postiz-redis:
123+
condition: service_healthy
124+
125+
postiz-postgres:
126+
image: postgres:17-alpine
127+
container_name: postiz-postgres
128+
restart: always
129+
environment:
130+
POSTGRES_PASSWORD: postiz-password
131+
POSTGRES_USER: postiz-user
132+
POSTGRES_DB: postiz-db-local
133+
volumes:
134+
- postgres-volume:/var/lib/postgresql/data
135+
networks:
136+
- postiz-network
137+
healthcheck:
138+
test: pg_isready -U postiz-user -d postiz-db-local
139+
interval: 10s
140+
timeout: 3s
141+
retries: 3
142+
postiz-redis:
143+
image: redis:7.2
144+
container_name: postiz-redis
145+
restart: always
146+
healthcheck:
147+
test: redis-cli ping
148+
interval: 10s
149+
timeout: 3s
150+
retries: 3
151+
volumes:
152+
- postiz-redis-data:/data
153+
networks:
154+
- postiz-network
155+
156+
# For Application Monitoring / Debugging
157+
spotlight:
158+
pull_policy: always
159+
container_name: spotlight
160+
ports:
161+
- 8969:8969/tcp
162+
image: ghcr.io/getsentry/spotlight:latest
163+
networks:
164+
- postiz-network
165+
166+
# -----------------------
167+
# Temporal Stack
168+
# -----------------------
169+
temporal-elasticsearch:
170+
container_name: temporal-elasticsearch
171+
image: elasticsearch:7.17.27
172+
environment:
173+
- cluster.routing.allocation.disk.threshold_enabled=true
174+
- cluster.routing.allocation.disk.watermark.low=512mb
175+
- cluster.routing.allocation.disk.watermark.high=256mb
176+
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
177+
- discovery.type=single-node
178+
- ES_JAVA_OPTS=-Xms256m -Xmx256m
179+
- xpack.security.enabled=false
180+
networks:
181+
- temporal-network
182+
expose:
183+
- 9200
184+
volumes:
185+
- /var/lib/elasticsearch/data
186+
187+
temporal-postgresql:
188+
container_name: temporal-postgresql
189+
image: postgres:16
190+
environment:
191+
POSTGRES_PASSWORD: temporal
192+
POSTGRES_USER: temporal
193+
networks:
194+
- temporal-network
195+
expose:
196+
- 5432
197+
volumes:
198+
- /var/lib/postgresql/data
199+
200+
temporal:
201+
container_name: temporal
202+
ports:
203+
- '7233:7233'
204+
image: temporalio/auto-setup:1.28.1
205+
depends_on:
206+
- temporal-postgresql
207+
- temporal-elasticsearch
208+
environment:
209+
- DB=postgres12
210+
- DB_PORT=5432
211+
- POSTGRES_USER=temporal
212+
- POSTGRES_PWD=temporal
213+
- POSTGRES_SEEDS=temporal-postgresql
214+
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml
215+
- ENABLE_ES=true
216+
- ES_SEEDS=temporal-elasticsearch
217+
- ES_VERSION=v7
218+
- TEMPORAL_NAMESPACE=default
219+
networks:
220+
- temporal-network
221+
volumes:
222+
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
223+
labels:
224+
kompose.volume.type: configMap
225+
226+
temporal-admin-tools:
227+
container_name: temporal-admin-tools
228+
image: temporalio/admin-tools:1.28.1-tctl-1.18.4-cli-1.4.1
229+
environment:
230+
- TEMPORAL_ADDRESS=temporal:7233
231+
- TEMPORAL_CLI_ADDRESS=temporal:7233
232+
networks:
233+
- temporal-network
234+
stdin_open: true
235+
depends_on:
236+
- temporal
237+
tty: true
238+
239+
temporal-ui:
240+
container_name: temporal-ui
241+
image: temporalio/ui:2.34.0
242+
environment:
243+
- TEMPORAL_ADDRESS=temporal:7233
244+
- TEMPORAL_CORS_ORIGINS=http://127.0.0.1:3000
245+
networks:
246+
- temporal-network
247+
ports:
248+
- '8080:8080'
249+
250+
volumes:
251+
postgres-volume:
252+
external: false
253+
254+
postiz-redis-data:
255+
external: false
256+
257+
postiz-config:
258+
external: false
259+
260+
postiz-uploads:
261+
external: false
262+
263+
networks:
264+
postiz-network:
265+
external: false
266+
temporal-network:
267+
driver: bridge
268+
name: temporal-network

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dev:docker": "docker compose -f ./docker-compose.dev.yaml up -d",
3131
"commands:build:development": "pnpm --filter ./apps/commands run build",
3232
"prisma-generate": "pnpm dlx prisma@6.5.0 generate --schema ./libraries/nestjs-libraries/src/database/prisma/schema.prisma",
33-
"prisma-db-push": "pnpm dlx prisma@6.5.0 db push --schema ./libraries/nestjs-libraries/src/database/prisma/schema.prisma",
33+
"prisma-db-push": "pnpm dlx prisma@6.5.0 db push --accept-data-loss --schema ./libraries/nestjs-libraries/src/database/prisma/schema.prisma",
3434
"prisma-db-pull": "pnpm dlx prisma@6.5.0 db pull --schema ./libraries/nestjs-libraries/src/database/prisma/schema.prisma",
3535
"prisma-reset": "cd ./libraries/nestjs-libraries/src/database/prisma && pnpm dlx prisma@6.5.0 db push --force-reset && pnpx prisma@6.5.0 db push",
3636
"docker-build": "./var/docker/docker-build.sh",

0 commit comments

Comments
 (0)