feat: init excalidraw repo

This commit is contained in:
Ivan I. Ovchinnikov
2025-12-15 17:33:27 +00:00
commit dc4da9f869
5 changed files with 120 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
APP_HOST=draw.nstest.local
ROOM_HOST=draw.nstest.local
STORAGE_BACKEND_HOST=draw.nstest.local/storage
DB_USER=
DB_PASS=
+2
View File
@@ -0,0 +1,2 @@
mongo-data/
.env
+57
View File
@@ -0,0 +1,57 @@
services:
app:
image: alswl/excalidraw:v0.18.0-fork-b3
restart: unless-stopped
environment:
- VITE_APP_BACKEND_V2_GET_URL=https://${STORAGE_BACKEND_HOST}/api/v2/scenes/
- VITE_APP_BACKEND_V2_POST_URL=https://${STORAGE_BACKEND_HOST}/api/v2/scenes/
- VITE_APP_WS_SERVER_URL=https://${ROOM_HOST}/
- VITE_APP_FIREBASE_CONFIG={}
- VITE_APP_HTTP_STORAGE_BACKEND_URL=https://${STORAGE_BACKEND_HOST}/api/v2
- VITE_APP_STORAGE_BACKEND=http
- VITE_APP_DISABLE_TRACKING=true
- PUBLIC_URL=https://${APP_HOST}
networks:
- draw
storage:
image: alswl/excalidraw-storage-backend:v2023.11.11
restart: unless-stopped
environment:
- STORAGE_URI=mongodb://${DB_USER}:${DB_PASS}@mongodb:27017
networks:
- draw
room:
image: excalidraw/excalidraw-room:sha-49bf529
restart: unless-stopped
environment:
PORT: 3002
networks:
- draw
mongodb:
image: mongo:7.0.5-jammy
restart: unless-stopped
environment:
- MONGO_INITDB_ROOT_USERNAME=${DB_USER}
- MONGO_INITDB_ROOT_PASSWORD=${DB_PASS}
volumes:
- ./mongo-data:/data/db
user: "1000"
networks:
- draw
nginx:
container_name: nginx-server-ex
image: nginx
restart: always
ports:
- 5000:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
networks:
- draw
networks:
draw:
+35
View File
@@ -0,0 +1,35 @@
events {}
http {
server {
listen 80;
location / {
proxy_pass http://app:80/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /storage/ {
proxy_pass http://storage:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io/ {
proxy_pass http://room:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
}
client_max_body_size 40M;
}
}
+20
View File
@@ -0,0 +1,20 @@
---
- name: Start Excalidraw
hosts: localhost
become: yes
vars:
mongodb_data_dir: "{{ playbook_dir }}/mongo-data"
tasks:
- name: Ensure Excalidraw directories exist and have permissions
file:
path: "{{ item }}"
state: directory
mode: '777'
loop:
- "{{ mongodb_data_dir }}"
- name: Start Excalidraw
command: docker-compose up -d
args:
chdir: "{{ playbook_dir }}"