Closed loranger closed 1 year ago
hmmm peppermint.docker should work as a base url
https://docs.peppermint.sh/proxy maybe this might help but its an nginx example
Thanks for your reply
Actually it works, but I cannot pass the login form. As you can see on the log output, it seems there's an issue with next and the csrf.
Did you succeeded to make peppermint run with traefik?
This will be resolved as i have departed from using next auth on the frontend :)
Hi, I try to run peppermint using traefik as a reverse proxy, but failed. Can you help ?
Here is my setup
.env
``` APP_PROJECT=peppermint APP_DOMAIN=peppermint.docker POSTGRES_USER=peppermint POSTGRES_PASSWORD=1234 POSTGRES_DB=peppermint PORT=5000 DB_USERNAME=${POSTGRES_USER} DB_PASSWORD=${POSTGRES_PASSWORD} DB_HOST=${APP_PROJECT}-postgres BASE_URL="http://${APP_DOMAIN}" ```docker-compose.yml
```yaml version: "3.1" services: postgres: container_name: ${APP_PROJECT}-postgres image: postgres:latest restart: always volumes: - ./db:/data/db env_file: - .env client: container_name: ${APP_PROJECT}-peppermint image: pepperlabs/peppermint:latest # ports: # - 5000:5000 restart: on-failure depends_on: - postgres env_file: - .env labels: - "traefik.http.routers.${APP_PROJECT}.rule=Host(`${APP_DOMAIN}`)" - "traefik.http.services.${APP_PROJECT}-service.loadbalancer.server.port=${PORT}" networks: default: name: web ```and here is my output whenever I try to login
output.log
``` docker compose up [+] Building 0.0s (0/0) [+] Running 2/0 ✔ Container peppermint-postgres Created 0.0s ✔ Container peppermint-peppermint Created 0.0s Attaching to peppermint-peppermint, peppermint-postgres peppermint-postgres | peppermint-postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization peppermint-postgres | peppermint-postgres | 2023-06-16 19:06:09.906 UTC [1] LOG: starting PostgreSQL 15.3 (Debian 15.3-1.pgdg110+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit peppermint-postgres | 2023-06-16 19:06:09.907 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 peppermint-postgres | 2023-06-16 19:06:09.907 UTC [1] LOG: listening on IPv6 address "::", port 5432 peppermint-postgres | 2023-06-16 19:06:09.909 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" peppermint-postgres | 2023-06-16 19:06:09.911 UTC [29] LOG: database system was shut down at 2023-06-16 19:06:03 UTC peppermint-postgres | 2023-06-16 19:06:09.913 UTC [1] LOG: database system is ready to accept connections peppermint-peppermint | yarn run v1.22.19 peppermint-peppermint | $ prisma migrate deploy peppermint-peppermint | Environment variables loaded from .env peppermint-peppermint | Prisma schema loaded from prisma/schema.prisma peppermint-peppermint | Datasource "db": PostgreSQL database "peppermint", schema "public" at "peppermint-postgres:5432" peppermint-peppermint | peppermint-peppermint | 3 migrations found in prisma/migrations peppermint-peppermint | peppermint-peppermint | peppermint-peppermint | No pending migrations to apply. peppermint-peppermint | Done in 2.56s. peppermint-peppermint | yarn run v1.22.19 peppermint-peppermint | $ prisma generate peppermint-peppermint | Environment variables loaded from .env peppermint-peppermint | Prisma schema loaded from prisma/schema.prisma peppermint-peppermint | peppermint-peppermint | ✔ Generated Prisma Client (3.7.0 | library) to ./node_modules/@prisma/client in 330ms peppermint-peppermint | You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client peppermint-peppermint | ``` peppermint-peppermint | import { PrismaClient } from '@prisma/client' peppermint-peppermint | const prisma = new PrismaClient() peppermint-peppermint | ``` peppermint-peppermint | peppermint-peppermint | warn Versions of prisma@3.14.0 and @prisma/client@3.7.0 don't match. peppermint-peppermint | This might lead to unexpected behavior. peppermint-peppermint | Please make sure they have the same version. peppermint-peppermint | ┌─────────────────────────────────────────────────────────┐ peppermint-peppermint | │ Update available 3.14.0 -> 4.15.0 │ peppermint-peppermint | │ │ peppermint-peppermint | │ This is a major update - please follow the guide at │ peppermint-peppermint | │ https://pris.ly/d/major-version-upgrade │ peppermint-peppermint | │ │ peppermint-peppermint | │ Run the following to update │ peppermint-peppermint | │ yarn add --dev prisma@latest │ peppermint-peppermint | │ yarn add @prisma/client@latest │ peppermint-peppermint | └─────────────────────────────────────────────────────────┘ peppermint-peppermint | Done in 13.21s. peppermint-peppermint | yarn run v1.22.19 peppermint-peppermint | $ prisma db seed peppermint-peppermint | Environment variables loaded from .env peppermint-peppermint | Running seed command `node prisma/seed.js` ... peppermint-peppermint | { peppermint-peppermint | admin: { peppermint-peppermint | id: 1, peppermint-peppermint | createdAt: 2023-06-16T18:49:51.534Z, peppermint-peppermint | updatedAt: 2023-06-16T18:49:51.536Z, peppermint-peppermint | name: 'admin', peppermint-peppermint | password: '$2b$10$BFmibvOW7FtY0soAAwujoO9y2tIyB7WEJ2HNq9O7zh9aeejMvRsKu', peppermint-peppermint | email: 'admin@admin.com', peppermint-peppermint | isAdmin: true peppermint-peppermint | }, peppermint-peppermint | internal: { peppermint-peppermint | id: 1, peppermint-peppermint | createdAt: 2023-06-16T18:49:51.608Z, peppermint-peppermint | updatedAt: 2023-06-16T18:49:51.608Z, peppermint-peppermint | name: 'internal', peppermint-peppermint | email: 'internal@admin.com', peppermint-peppermint | contactName: 'admin', peppermint-peppermint | number: '123456789', peppermint-peppermint | notes: null peppermint-peppermint | } peppermint-peppermint | } peppermint-peppermint | peppermint-peppermint | 🌱 The seed command has been executed. peppermint-peppermint | Done in 3.03s. peppermint-peppermint | yarn run v1.22.19 peppermint-peppermint | $ next start peppermint-peppermint | ready - started server on 0.0.0.0:5000, url: http://localhost:5000 peppermint-peppermint | info - Loaded env from /app/.env peppermint-peppermint | warn - SWC minify beta enabled. https://nextjs.org/docs/messages/swc-minify-enabled peppermint-peppermint | [next-auth][error][CLIENT_FETCH_ERROR] peppermint-peppermint | https://next-auth.js.org/errors#client_fetch_error request to http://peppermint.docker/api/auth/csrf failed, reason: connect ECONNREFUSED 127.0.0.1:80 { peppermint-peppermint | error: { peppermint-peppermint | message: 'request to http://peppermint.docker/api/auth/csrf failed, reason: connect ECONNREFUSED 127.0.0.1:80', peppermint-peppermint | stack: 'FetchError: request to http://peppermint.docker/api/auth/csrf failed, reason: connect ECONNREFUSED 127.0.0.1:80\n' + peppermint-peppermint | ' at ClientRequest.Did I miss something ? An environment variable maybe ?