Closed decentral1se closed 8 months ago
Hi @decentral1se , we may not add it to v1, but what you can do is fork the repo, and create a docker image from there! or get only the website in the folder apps/www
Would the apps/www be enough to self host this in a container? I currently use WBO running locally because it has a very easy container but I really like some of the features tldraw has
Hello, I would also be interested in an Docker image! Would be glad if this makes it into the release :)
@nickelswitte @rothgar
Hello, I would also be interested in an Docker image! Would be glad if this makes it into the release :)
Hello everyone,
I wrote a dockerfile for self host tldraw.
As you probably already guessed, the multiplayer does not work.
Concerning the bucket s3 part, for complete self hostable, it is totally possible to use minio, which is a bucket s3 self hostable. See my medium article to make it work with outline-wiki : https://link.medium.com/yhtWcqQxNyb
It will obviously be possible to make a dockerfile when dev decide to stop using liveblocks.io, or at least leave the possibility with alternatives using environment variables, same for the s3 bucket, to make the multiplayer working.
regarding the dockerfile, this is the tldraw site and not the example. To run the example you can modify the dockerfile. Warning : it will be heavier since you have to build from the root folder and have yarn for dependencies, this is the problem of mono repo.
Please note : I didn't do PR because I don’t know what the dev plan to do or not, whether they want to integrate or not. If many people want the dockerfile to be integrated I will do a PR.
In order to make it yourself : pre-requesite : docker & git
Step 1 : Go into a directory and git clone tldraw project :
git clone https://github.com/tldraw/tldraw.git
Step 2 : Create a new file named 'dockerfile' at the root of the project you just cloned and paste the following code :
# Written by Ange Cesari
# Use official Node.js based on Alpine
FROM node:16-alpine
# Install Yarn
RUN apk add --no-cache yarn
# Create dir for application
WORKDIR /usr/src/app
# Copy files from apps/www to workdir
COPY apps/www .
# Change workdir to apps/www
WORKDIR /usr/src/app/apps/www
# Install dependencies with yarn
RUN yarn
# Expose application port (5420 for the tldraw/example)
EXPOSE 3000
# Run application in dev mode
CMD ["yarn", "dev"]
Step 3 : Go in the root directory and build your own image
docker build -t tldraw .
Step 4 : (after waiting some time because of the dependencies) run the docker container :
docker run -d -p 3000:3000 --name tldraw-container tldraw
Step 5 : Wait a little bit of time so it starts properly and connect to http://localhost:3000
in your web browser
You should be able to see the tldraw page.
https://hub.docker.com/r/geekyouth/tldraw
docker run --name tldraw -p 3000:3000 -d geekyouth/tldraw:2.0.0-alpha.18
OR
version: "3.9"
services:
tldraw:
image: geekyouth/tldraw:2.0.0-alpha.18
hostname: tldraw
container_name: tldraw-dev
environment:
TZ: Asia/Shanghai
ports:
- "3000:3000"
FROM node:16-alpine AS BASE
WORKDIR /app
COPY . .
RUN npm install --registry=https://registry.npmmirror.com
EXPOSE 3000
CMD ["npm", "run", "start"]
# docker run --name tldraw -p 3000:3000 -d geekyouth/tldraw:2.0.0-alpha.18
Hi, closing this one. We're still looking at what a self-hostable version of tldraw could look like. Check https://github.com/tldraw/tldraw for the latest!
Would be great, especially for self-hosting options for tldraw :love_you_gesture: