Merge pull request #3040 from lily-mara/dev-env-fixes

Improve developer environment onboarding
This commit is contained in:
Jackson Harper
2023-11-03 16:05:11 +08:00
committed by GitHub
3 changed files with 41 additions and 24 deletions

View File

@ -2,7 +2,7 @@
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/omnivore-app/omnivore/Run%20tests)](https://github.com/omnivore-app/omnivore/actions/workflows/run-tests.yaml)
[![Discord](https://img.shields.io/discord/844965259462311966?label=Join%20our%20Discord)](https://discord.gg/h2z5rppzz9)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/109458738600914558?domain=https%3A%2F%2Fpkm.social)](https://pkm.social/@omnivore)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/109458738600914558?domain=https%3A%2F%2Fpkm.social)](https://pkm.social/@omnivore)
[![Twitter Follow](https://img.shields.io/twitter/follow/omnivoreapp)](https://twitter.com/OmnivoreApp)
![GitHub](https://img.shields.io/github/license/omnivore-app/omnivore)
@ -34,7 +34,6 @@ We also have a free hosted version of Omnivore at [omnivore.app](https://omnivor
<img width="981" alt="web-screenshot-listview" src="https://github.com/omnivore-app/omnivore/assets/75189/df7c797a-4255-42f4-a686-ad94866cb580">
## Join us on Discord! :speech_balloon:
We're building our community on Discord. [Join us!](https://discord.gg/h2z5rppzz9)
@ -100,10 +99,22 @@ with docker compose and the frontend locally:
```bash
docker compose up api content-fetch
cd packages/web
cp .env.template .env
cp .env.template .env.local
yarn dev
```
You will need to configure some values in the new `.env.local` file. These are
the values for running the `web` service directly on your host machine and
running `api` and `content-fetch` within docker:
```sh
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NEXT_PUBLIC_HIGHLIGHTS_BASE_URL=http://localhost:3000
NEXT_PUBLIC_LOCAL_BASE_URL=http://localhost:3000
NEXT_PUBLIC_SERVER_BASE_URL=http://localhost:4000
NEXT_PUBLIC_LOCAL_SERVER_BASE_URL=http://localhost:4000
```
### Running the puppeteer-parse service outside of Docker
To save pages you need to run the `puppeteer-parse` service.

View File

@ -1,7 +1,7 @@
version: '3'
services:
postgres:
image: "postgres:12.8"
image: "ankane/pgvector:v0.5.1"
container_name: "omnivore-postgres"
environment:
- POSTGRES_USER=postgres

View File

@ -24,28 +24,34 @@ const moduleExports = {
'proxy.omnivore-image-cache.app',
],
},
rewrites: () => [
{
source: '/api/graphql',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/graphql`,
},
{
source: '/api/auth/:path*',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/auth/:path*`,
},
{
source: '/api/article/save',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/article/save`,
},
{
source: '/api/mobile-auth/:path*',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/mobile-auth/:path*`,
},
{
rewrites: () => {
const rewrites = []
if (process.env.INCLUDE_LEGACY_REWRITES) {
rewrites.push(
{
source: '/api/graphql',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/graphql`,
},
{
source: '/api/auth/:path*',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/auth/:path*`,
},
{
source: '/api/article/save',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/article/save`,
},
{
source: '/api/mobile-auth/:path*',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/mobile-auth/:path*`,
}
)
}
rewrites.push({
source: '/collect/:match*',
destination: 'https://app.posthog.com/:match*',
},
],
})
return rewrites
},
async headers() {
return [
{