Skip to content

Commit f699e1d

Browse files
committed
Remote Container: Setup remote instance container
1 parent 4fad11f commit f699e1d

File tree

17 files changed

+2122
-4897
lines changed

17 files changed

+2122
-4897
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ node_modules
99
# misc
1010
.DS_Store
1111
*.pem
12+
*.cert
1213

1314
# local env files
1415
.env*.local

package-lock.json

Lines changed: 192 additions & 4659 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

remote-instance/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
certs/
2+
dist/
3+
node_modules/

remote-instance/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SSL_CERT_PATH=path_to_cert
2+
SSL_KEY_PATH=path_to_key
3+
# You can modify this to custom frontend deployment URL
4+
FRONTEND_URL=https://editor.pulse-editor.com

remote-instance/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
certs/
2+
dist/
3+
node_modules/

remote-instance/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Pulse Editor Remote Instance
2+
3+
This repo contains source code of a remote instance.
4+
5+
## Self-host a remote instance
6+
7+
Production:
8+
9+
```bash
10+
npm run build
11+
npm run start
12+
```
13+
14+
Development:
15+
16+
```bash
17+
npm run dev
18+
```
19+
20+
## Configure SSL
21+
22+
Create `.env` file in current folder, and set `SSL_CERT_PATH` and `SSL_KEY_PATH` (check example file `.env.example`)
23+
24+
## Optional: create self-signed SSL for HTTPS connection
25+
26+
Generate self-signed SSL certificates:
27+
28+
```bash
29+
bash ./generate-self-signed.sh
30+
```

remote-instance/dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM ubuntu:latest
2+
ENV NODE_VERSION=20
3+
4+
WORKDIR /app
5+
6+
# install curl
7+
RUN apt update && apt install -y curl make python3 build-essential
8+
9+
# install nvm
10+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
11+
12+
# set env
13+
ENV NVM_DIR=/root/.nvm
14+
15+
COPY . /app
16+
17+
# install node
18+
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && npm install && npm run build"
19+
20+
# Generate self-signed certificate
21+
# RUN bash -c "./utils/generate-self-signed.sh"
22+
23+
# set ENTRYPOINT for reloading nvm-environment
24+
ENTRYPOINT ["bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"]
25+
26+
EXPOSE 6080 6443
27+
28+
CMD ["npm", "run", "start"]

0 commit comments

Comments
 (0)