]> Untitled Git - lemmy.git/blob - docker/docker-compose.yml
Fix typo that caused error (#2861)
[lemmy.git] / docker / docker-compose.yml
1 version: "3.3"
2
3 networks:
4   # communication to web and clients
5   lemmyexternalproxy:
6   # communication between lemmy services
7   lemmyinternal:
8     driver: bridge
9     internal: true
10
11 services:
12   proxy:
13     image: nginx:1-alpine
14     networks:
15       - lemmyinternal
16       - lemmyexternalproxy
17     ports:
18       # actual and only port facing any connection from outside
19       - "1236:1236"
20       - "8536:8536"
21     volumes:
22       - ./nginx.conf:/etc/nginx/nginx.conf:ro,Z
23     restart: always
24     depends_on:
25       - pictrs
26       - lemmy-ui
27
28   lemmy:
29     # image: dessalines/lemmy:dev
30     # use this to build your local lemmy server image for development
31     # run docker compose up --build
32     build:
33       context: ../
34       dockerfile: docker/Dockerfile
35       # args:
36       #   RUST_RELEASE_MODE: release
37     # this hostname is used in nginx reverse proxy and also for lemmy ui to connect to the backend, do not change
38     hostname: lemmy
39     networks:
40       - lemmyinternal
41     restart: always
42     environment:
43       - RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
44       - RUST_BACKTRACE=full
45     volumes:
46       - ./lemmy.hjson:/config/config.hjson:Z
47     depends_on:
48       - postgres
49       - pictrs
50
51   lemmy-ui:
52     image: dessalines/lemmy-ui:0.17.1
53     # use this to build your local lemmy ui image for development
54     # run docker compose up --build
55     # assuming lemmy-ui is cloned besides lemmy directory
56     # build:
57     #   context: ../../lemmy-ui
58     #   dockerfile: dev.dockerfile
59     networks:
60       - lemmyinternal
61     environment:
62       # this needs to match the hostname defined in the lemmy service
63       - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
64       # set the outside hostname here
65       - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
66       - LEMMY_HTTPS=false
67       - LEMMY_UI_DEBUG=true
68     depends_on:
69       - lemmy
70     restart: always
71
72   pictrs:
73     image: asonix/pictrs:0.4.0-beta.19
74     # this needs to match the pictrs url in lemmy.hjson
75     hostname: pictrs
76     # we can set options to pictrs like this, here we set max. image size and forced format for conversion
77     # entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
78     networks:
79       - lemmyinternal
80     environment:
81       - PICTRS_OPENTELEMETRY_URL=http://otel:4137
82       - PICTRS__API_KEY=API_KEY
83       - RUST_LOG=debug
84       - RUST_BACKTRACE=full
85       - PICTRS__MEDIA__VIDEO_CODEC=vp9
86       - PICTRS__MEDIA__GIF__MAX_WIDTH=256
87       - PICTRS__MEDIA__GIF__MAX_HEIGHT=256
88       - PICTRS__MEDIA__GIF__MAX_AREA=65536
89       - PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400
90     user: 991:991
91     volumes:
92       - ./volumes/pictrs:/mnt:Z
93     restart: always
94
95   postgres:
96     image: postgres:15-alpine
97     # this needs to match the database host in lemmy.hson
98     # Tune your settings via
99     # https://pgtune.leopard.in.ua/#/
100     # You can use this technique to add them here
101     # https://stackoverflow.com/a/30850095/1655478
102     hostname: postgres
103     command:
104       [
105         "postgres",
106         "-c",
107         "session_preload_libraries=auto_explain",
108         "-c",
109         "auto_explain.log_min_duration=5ms",
110         "-c",
111         "auto_explain.log_analyze=true",
112         "-c",
113         "track_activity_query_size=1048576",
114       ]
115     networks:
116       - lemmyinternal
117       # adding the external facing network to allow direct db access for devs
118       - lemmyexternalproxy
119     ports:
120       # use a different port so it doesnt conflict with potential postgres db running on the host
121       - "5433:5432"
122     environment:
123       - POSTGRES_USER=lemmy
124       - POSTGRES_PASSWORD=password
125       - POSTGRES_DB=lemmy
126     volumes:
127       - ./volumes/postgres:/var/lib/postgresql/data:Z
128     restart: always
129
130   otel:
131     image: otel/opentelemetry-collector:latest
132     command: --config otel-local-config.yaml
133     networks:
134       - lemmyinternal
135       - lemmyexternalproxy
136     ports:
137       - "4317:4317"
138     volumes:
139       - ./otel.yml:/otel-local-config.yaml:Z
140     restart: unless-stopped
141     depends_on:
142       - jaeger
143
144   jaeger:
145     image: jaegertracing/all-in-one:1
146     networks:
147       - lemmyinternal
148       - lemmyexternalproxy
149     ports:
150       - "14250:14250"
151       # To view traces, visit http://localhost:16686
152       - "16686:16686"
153     restart: unless-stopped