]> Untitled Git - lemmy.git/blob - docker/dev/docker-compose.yml
Add diesel_async, get rid of blocking function (#2510)
[lemmy.git] / docker / dev / 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     volumes:
21       - ./nginx.conf:/etc/nginx/nginx.conf:ro
22     restart: always
23     depends_on:
24       - pictrs
25       - lemmy-ui
26
27   lemmy:
28     # image: dessalines/lemmy:dev
29     # use this to build your local lemmy server image for development
30     # run docker compose up --build
31     build: 
32       context: ../..
33       dockerfile: docker/dev/Dockerfile
34     # this hostname is used in nginx reverse proxy and also for lemmy ui to connect to the backend, do not change
35     hostname: lemmy
36     networks:
37       - lemmyinternal
38     restart: always
39     environment:
40       - 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"
41       - RUST_BACKTRACE=full
42     volumes:
43       - ./lemmy.hjson:/config/config.hjson
44     depends_on:
45       - postgres
46       - pictrs
47
48   lemmy-ui:
49     # image: dessalines/lemmy-ui:dev
50     # use this to build your local lemmy ui image for development
51     # run docker compose up --build
52     # assuming lemmy-ui is cloned besides lemmy directory
53     build: 
54      context: ../../../lemmy-ui
55      dockerfile: dev.dockerfile
56     networks:
57       - lemmyinternal
58     environment:
59       # this needs to match the hostname defined in the lemmy service
60       - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
61       # set the outside hostname here
62       - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
63       - LEMMY_HTTPS=false
64       - LEMMY_UI_DEBUG=true
65     depends_on:
66       - lemmy
67     restart: always
68
69   pictrs:
70     image: asonix/pictrs:0.3.1
71     # this needs to match the pictrs url in lemmy.hjson
72     hostname: pictrs
73     # we can set options to pictrs like this, here we set max. image size and forced format for conversion
74     # entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
75     networks:
76       - lemmyinternal
77     environment:
78       - PICTRS_OPENTELEMETRY_URL=http://otel:4137
79       - PICTRS__API_KEY=API_KEY
80       - RUST_LOG=debug
81       - RUST_BACKTRACE=full
82     user: 991:991
83     volumes:
84       - ./volumes/pictrs:/mnt
85     restart: always
86
87   postgres:
88     image: postgres:14-alpine
89     # this needs to match the database host in lemmy.hson
90     hostname: postgres
91     command: ["postgres", "-c", "session_preload_libraries=auto_explain", "-c", "auto_explain.log_min_duration=5ms", "-c", "auto_explain.log_analyze=true"]
92     networks:
93       - lemmyinternal
94     # adding the external facing network to allow direct db access for devs
95       - lemmyexternalproxy
96     ports:
97     # use a different port so it doesnt conflict with potential postgres db running on the host
98       - "5433:5432"
99     environment:
100       - POSTGRES_USER=lemmy
101       - POSTGRES_PASSWORD=password
102       - POSTGRES_DB=lemmy
103     volumes:
104       - ./volumes/postgres:/var/lib/postgresql/data
105     restart: always
106
107   otel:
108     image: otel/opentelemetry-collector:latest
109     command: --config otel-local-config.yaml
110     networks:
111       - lemmyinternal
112       - lemmyexternalproxy
113     ports:
114       - "4317:4317"
115     volumes:
116       - type: bind
117         source: ./otel.yml
118         target: /otel-local-config.yaml
119     restart: unless-stopped
120     depends_on:
121       - jaeger
122   
123   jaeger:
124     image: jaegertracing/all-in-one:1
125     networks:
126       - lemmyinternal
127       - lemmyexternalproxy
128     ports:
129       - "14250:14250"
130       # To view traces, visit http://localhost:16686
131       - "16686:16686"
132     restart: unless-stopped