README: add pm2 instructions

This commit is contained in:
Max Leiter 2022-03-28 20:57:13 -07:00
parent fb8f14fd98
commit 7505bb43fe
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: A3512F2F2F17EBDA
2 changed files with 17 additions and 12 deletions

View file

@ -43,6 +43,18 @@ You can change these to your liking.
- `ENABLE_ADMIN`: the first account created is an administrator account
- `DRIFT_HOME`: defaults to ~/.drift, the directory for storing the database and eventually images
## Running with pm2
It's easy to start Drift using [pm2](https://pm2.keymetrics.io/).
First, add `.env` files to `client/` and `server/` with thev values you want (see the above section for possible values).
Then, use the following commands to start the client and server:
- `cd server && yarn build && pm2 start yarn --name drift-server --interpreter bash -- start`
- `cd ..`
- `cd client && yarn build && pm2 start yarn --name drift-client --interpreter bash -- start`
You now use `pm2 ls` to see their statuses. Refer to pm2's docs or `pm2 help` for more information.
## Current status
Drift is a major work in progress. Below is a (rough) list of completed and envisioned features. If you want to help address any of them, please let me know regardless of your experience and I'll be happy to assist.

View file

@ -10,29 +10,22 @@ services:
environment:
- JWT_SECRET=change_me! # use `openssl rand -hex 32` to generate a strong secret
- SECRET_KEY=secret
expose:
- 3000
ports:
- "3000:3000"
networks:
- general
healthcheck:
test: [ "CMD", "curl", "-s", "localhost:3000"]
interval: 10s
timeout: 45s
retries: 10
container_name: server
client:
build:
context: ./client
network: host
args:
API_URL: http://localhost:3000
API_URL: http://server:3000
SECRET_KEY: secret
restart: unless-stopped
user: 1000:1000
environment:
- API_URL=http://localhost:3000
- API_URL=http://server:3000
- SECRET_KEY=secret
ports:
- "3001:3001"
@ -40,9 +33,9 @@ services:
- 3001
networks:
- general
depends_on:
server:
condition: service_healthy
# depends_on:
# server:
# condition: service_healthy
container_name: client
networks: