add docker dev environment

This commit is contained in:
Martin Fehlhaber
2020-12-21 12:07:17 +01:00
committed by Tienson Qin
parent b40b5925f7
commit 5b4ca742a6
2 changed files with 47 additions and 0 deletions

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM clojure:openjdk-11-tools-deps
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - && \
apt-get install -y nodejs
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y yarn
RUN useradd -ms /bin/bash logseq
USER logseq
WORKDIR /home/logseq
EXPOSE 3001
EXPOSE 9630
EXPOSE 8701

View File

@@ -87,3 +87,32 @@ Open <http://localhost:3001>.
``` bash
yarn release
```
## Alternative: Docker based development environment
### 1. Fetch sources
``` bash
git clone https://github.com/logseq/logseq
```
### 2. Build Docker image
``` bash
cd logseq
docker build -t logseq-docker .
```
### 3. Run Docker container
``` bash
docker run -v $(pwd):/home/logseq/logseq -p 3001:3001 -p 9630:9630 -p 8701:8701 --rm -it logseq-docker /bin/bash
```
### 4. Inside the container compile as described above
``` bash
cd logseq
yarn
yarn watch
```