|
|
@@ -1,11 +1,8 @@
|
|
|
|
# How To Work On Synapsis
|
|
|
|
# How To Work On Synapsis
|
|
|
|
|
|
|
|
|
|
|
|
This is the practical workflow for developing Synapsis without turning every bugfix into a full Docker release.
|
|
|
|
This is the practical workflow for developing Synapsis without turning every bugfix into a full Docker release.
|
|
|
|
|
|
|
|
|
|
|
|
## The Basic Rule
|
|
|
|
## Basic Rule
|
|
|
|
|
|
|
|
|
|
|
|
Use three different loops for three different jobs:
|
|
|
|
Use three different loops for three different jobs:
|
|
|
|
|
|
|
|
|
|
|
|
1. `npm run dev` for normal feature work and bugfixes
|
|
|
|
1. `npm run dev` for normal feature work and bugfixes
|
|
|
|
2. local Docker source builds when you need container parity
|
|
|
|
2. local Docker source builds when you need container parity
|
|
|
|
3. GHCR publish only when you actually want the server to update
|
|
|
|
3. GHCR publish only when you actually want the server to update
|
|
|
@@ -13,7 +10,6 @@ Use three different loops for three different jobs:
|
|
|
|
Do **not** rebuild and push a Docker image for every tiny fix. Batch fixes together, verify them locally, then publish when the server needs the new version.
|
|
|
|
Do **not** rebuild and push a Docker image for every tiny fix. Batch fixes together, verify them locally, then publish when the server needs the new version.
|
|
|
|
|
|
|
|
|
|
|
|
## 1. Normal Local Development
|
|
|
|
## 1. Normal Local Development
|
|
|
|
|
|
|
|
|
|
|
|
Use this for most day-to-day work.
|
|
|
|
Use this for most day-to-day work.
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
```bash
|
|
|
@@ -38,10 +34,7 @@ Use this loop when:
|
|
|
|
- you do not specifically need to test the Docker runtime
|
|
|
|
- you do not specifically need to test the Docker runtime
|
|
|
|
|
|
|
|
|
|
|
|
## 2. Local Docker Parity Test
|
|
|
|
## 2. Local Docker Parity Test
|
|
|
|
|
|
|
|
Use this when you want to know whether the app still works inside the actual container setup. This compose file builds from your local source tree:
|
|
|
|
Use this when you want to know whether the app still works inside the actual container setup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This compose file builds from your local source tree:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
```bash
|
|
|
|
cd docker
|
|
|
|
cd docker
|
|
|
@@ -49,9 +42,7 @@ cp .env.example .env
|
|
|
|
docker compose up --build
|
|
|
|
docker compose up --build
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
That uses:
|
|
|
|
That uses [docker/docker-compose.yml](/Users/christopher/Dev/Synapsis/Synapsis/docker/docker-compose.yml) and [docker/Dockerfile](/Users/christopher/Dev/Synapsis/Synapsis/docker/Dockerfile).
|
|
|
|
- [docker/docker-compose.yml](/Users/christopher/Dev/Synapsis/Synapsis/docker/docker-compose.yml)
|
|
|
|
|
|
|
|
- [docker/Dockerfile](/Users/christopher/Dev/Synapsis/Synapsis/docker/Dockerfile)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Use this loop when:
|
|
|
|
Use this loop when:
|
|
|
|
- Docker-specific startup behavior matters
|
|
|
|
- Docker-specific startup behavior matters
|
|
|
@@ -59,22 +50,15 @@ Use this loop when:
|
|
|
|
- you changed env handling, healthchecks, migrations, ports, or install flow
|
|
|
|
- you changed env handling, healthchecks, migrations, ports, or install flow
|
|
|
|
|
|
|
|
|
|
|
|
## 3. Production Image Publish
|
|
|
|
## 3. Production Image Publish
|
|
|
|
|
|
|
|
Use this only when you want the server or end users to pull a new image. The production install uses [docker-compose.yml](/Users/christopher/Dev/Synapsis/Synapsis/docker-compose.yml) and `ghcr.io/gnosyslabs/synapsis:latest`.
|
|
|
|
Use this only when you want the server or end users to pull a new image.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The production install uses:
|
|
|
|
|
|
|
|
- [docker-compose.yml](/Users/christopher/Dev/Synapsis/Synapsis/docker-compose.yml)
|
|
|
|
|
|
|
|
- image: `ghcr.io/gnosyslabs/synapsis:latest`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### First-time GHCR auth on this machine
|
|
|
|
### First-time GHCR auth on this machine
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
```bash
|
|
|
|
gh auth refresh -h github.com -s read:packages -s write:packages
|
|
|
|
gh auth refresh -h github.com -s read:packages -s write:packages
|
|
|
|
gh auth token | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
|
|
|
|
gh auth token | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Publish the image
|
|
|
|
### Publish the image
|
|
|
|
|
|
|
|
|
|
|
|
Push code first:
|
|
|
|
Push code first:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
```bash
|
|
|
@@ -101,7 +85,6 @@ That publishes:
|
|
|
|
If you are not on a Mac/Colima setup, swap `--builder colima` for whatever local buildx builder you use.
|
|
|
|
If you are not on a Mac/Colima setup, swap `--builder colima` for whatever local buildx builder you use.
|
|
|
|
|
|
|
|
|
|
|
|
## 4. Update The Server
|
|
|
|
## 4. Update The Server
|
|
|
|
|
|
|
|
|
|
|
|
Once a new image is published, update the server with:
|
|
|
|
Once a new image is published, update the server with:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
```bash
|
|
|
@@ -119,13 +102,10 @@ docker compose images
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 5. Which Compose File Is Which
|
|
|
|
## 5. Which Compose File Is Which
|
|
|
|
|
|
|
|
|
|
|
|
There are two main Docker compose paths in this repo.
|
|
|
|
There are two main Docker compose paths in this repo.
|
|
|
|
|
|
|
|
|
|
|
|
### Local source-build compose
|
|
|
|
### Local source-build compose
|
|
|
|
|
|
|
|
File: [docker/docker-compose.yml](/Users/christopher/Dev/Synapsis/Synapsis/docker/docker-compose.yml)
|
|
|
|
File:
|
|
|
|
|
|
|
|
- [docker/docker-compose.yml](/Users/christopher/Dev/Synapsis/Synapsis/docker/docker-compose.yml)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Purpose:
|
|
|
|
Purpose:
|
|
|
|
- local Docker testing
|
|
|
|
- local Docker testing
|
|
|
@@ -133,9 +113,7 @@ Purpose:
|
|
|
|
- no GHCR push required
|
|
|
|
- no GHCR push required
|
|
|
|
|
|
|
|
|
|
|
|
### Production install compose
|
|
|
|
### Production install compose
|
|
|
|
|
|
|
|
File: [docker-compose.yml](/Users/christopher/Dev/Synapsis/Synapsis/docker-compose.yml)
|
|
|
|
File:
|
|
|
|
|
|
|
|
- [docker-compose.yml](/Users/christopher/Dev/Synapsis/Synapsis/docker-compose.yml)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Purpose:
|
|
|
|
Purpose:
|
|
|
|
- end-user install
|
|
|
|
- end-user install
|
|
|
@@ -145,9 +123,7 @@ Purpose:
|
|
|
|
Do not confuse them.
|
|
|
|
Do not confuse them.
|
|
|
|
|
|
|
|
|
|
|
|
## 6. Recommended Workflow
|
|
|
|
## 6. Recommended Workflow
|
|
|
|
|
|
|
|
|
|
|
|
This is the default path that makes the most sense for Synapsis:
|
|
|
|
This is the default path that makes the most sense for Synapsis:
|
|
|
|
|
|
|
|
|
|
|
|
1. Make code changes locally
|
|
|
|
1. Make code changes locally
|
|
|
|
2. Run `npm run type-check`
|
|
|
|
2. Run `npm run type-check`
|
|
|
|
3. Run `npm run build`
|
|
|
|
3. Run `npm run build`
|
|
|
@@ -158,7 +134,6 @@ This is the default path that makes the most sense for Synapsis:
|
|
|
|
8. Pull and restart on the server
|
|
|
|
8. Pull and restart on the server
|
|
|
|
|
|
|
|
|
|
|
|
## 7. When To Publish A New Docker Image
|
|
|
|
## 7. When To Publish A New Docker Image
|
|
|
|
|
|
|
|
|
|
|
|
Publish when:
|
|
|
|
Publish when:
|
|
|
|
- you want the fix on the real server
|
|
|
|
- you want the fix on the real server
|
|
|
|
- you changed install/runtime/container behavior
|
|
|
|
- you changed install/runtime/container behavior
|
|
|
@@ -169,7 +144,6 @@ Do not publish just because:
|
|
|
|
- one small API bug was fixed and not needed on the server yet
|
|
|
|
- one small API bug was fixed and not needed on the server yet
|
|
|
|
|
|
|
|
|
|
|
|
## 8. Current Install Reality
|
|
|
|
## 8. Current Install Reality
|
|
|
|
|
|
|
|
|
|
|
|
For clean servers, the normal install path is:
|
|
|
|
For clean servers, the normal install path is:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
```bash
|
|
|
|