Open nestormata opened 4 days ago
I've managed to get it to work in portainer running on truenas scale 24.10. I am using cloudflare to handle https, and I am mounting the keys from files instead of passing them as environment variables to avoid potential formatting issues.
I made sure the key files had the correct permissions:
chmod 600 storage/oauth-keys/oauth-private.key
chmod 644 storage/oauth-keys/oauth-public.key
chown -R 1000:1000 storage/oauth-keys
here's my docker-compose.yaml
services:
cloudflared:
image: cloudflare/cloudflared:latest
restart: always
command: tunnel run --token ${CLOUDFLARE_TUNNEL_TOKEN}
networks:
- internal
environment:
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
app:
restart: always
image: "solidtime/solidtime:${SOLIDTIME_IMAGE_TAG:-latest}"
user: "1000:1000"
networks:
- internal
volumes:
- "app-storage:/var/www/html/storage"
- "./logs:/var/www/html/storage/logs"
- "./app-storage:/var/www/html/storage/app"
- "./storage/oauth-keys:/var/www/html/storage/oauth-keys"
environment:
CONTAINER_MODE: http
APP_ENV: production
APP_DEBUG: "true"
APP_URL: "https://yourdomain.com"
APP_FORCE_HTTPS: "true"
TRUSTED_PROXIES: "0.0.0.0/0,2000:0:0:0:0:0:0:0/3"
APP_KEY: ${APP_KEY}
PASSPORT_PRIVATE_KEY_PATH: /var/www/html/storage/oauth-keys/oauth-private.key
PASSPORT_PUBLIC_KEY_PATH: /var/www/html/storage/oauth-keys/oauth-public.key
SUPER_ADMINS: ${SUPER_ADMINS}
LOG_CHANNEL: stderr_daily
LOG_LEVEL: debug
DB_CONNECTION: pgsql
DB_HOST: database
DB_PORT: 5432
DB_SSLMODE: require
DB_DATABASE: solidtime
DB_USERNAME: solidtime
DB_PASSWORD: randompassword
MAIL_MAILER: smtp
MAIL_HOST: ${MAIL_HOST}
MAIL_PORT: ${MAIL_PORT}
MAIL_ENCRYPTION: tls
MAIL_FROM_ADDRESS: "no-reply@yourdomain.com"
MAIL_FROM_NAME: solidtime
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
QUEUE_CONNECTION: database
FILESYSTEM_DISK: local
PUBLIC_FILESYSTEM_DISK: public
SESSION_DOMAIN: "yourdomain.com"
SANCTUM_STATEFUL_DOMAINS: "yourdomain.com"
SESSION_SECURE_COOKIE: "true"
CORS_ALLOWED_ORIGINS: "https://yourdomain.com"
API_URL: "https://yourdomain.com"
healthcheck:
test: [ "CMD-SHELL", "curl --fail http://localhost:8000/health-check/up || exit 1" ]
depends_on:
- database
scheduler:
restart: always
image: "solidtime/solidtime:${SOLIDTIME_IMAGE_TAG:-latest}"
user: "1000:1000"
networks:
- internal
volumes:
- "app-storage:/var/www/html/storage"
- "./logs:/var/www/html/storage/logs"
- "./app-storage:/var/www/html/storage/app"
environment:
CONTAINER_MODE: scheduler
APP_ENV: production
APP_DEBUG: "false"
APP_URL: "https://yourdomain.com"
APP_FORCE_HTTPS: "true"
TRUSTED_PROXIES: "0.0.0.0/0,2000:0:0:0:0:0:0:0/3"
APP_KEY: ${APP_KEY}
PASSPORT_PRIVATE_KEY_PATH: /var/www/html/storage/oauth-keys/oauth-private.key
PASSPORT_PUBLIC_KEY_PATH: /var/www/html/storage/oauth-keys/oauth-public.key
SUPER_ADMINS: ${SUPER_ADMINS}
LOG_CHANNEL: stderr_daily
LOG_LEVEL: debug
DB_CONNECTION: pgsql
DB_HOST: database
DB_PORT: 5432
DB_SSLMODE: prefer
DB_DATABASE: solidtime
DB_USERNAME: solidtime
DB_PASSWORD: randompassword
MAIL_MAILER: smtp
MAIL_HOST: ${MAIL_HOST}
MAIL_PORT: ${MAIL_PORT}
MAIL_ENCRYPTION: tls
MAIL_FROM_ADDRESS: "no-reply@yourdomain.com"
MAIL_FROM_NAME: solidtime
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
QUEUE_CONNECTION: database
FILESYSTEM_DISK: local
PUBLIC_FILESYSTEM_DISK: public
healthcheck:
test: [ "CMD-SHELL", "supervisorctl status scheduler:scheduler_00" ]
depends_on:
- database
queue:
restart: always
image: "solidtime/solidtime:${SOLIDTIME_IMAGE_TAG:-latest}"
user: "1000:1000"
networks:
- internal
volumes:
- "app-storage:/var/www/html/storage"
- "./logs:/var/www/html/storage/logs"
- "./app-storage:/var/www/html/storage/app"
environment:
CONTAINER_MODE: worker
WORKER_COMMAND: "php /var/www/html/artisan queue:work"
APP_ENV: production
APP_DEBUG: "false"
APP_URL: "https://yourdomain.com"
APP_FORCE_HTTPS: "true"
TRUSTED_PROXIES: "0.0.0.0/0,2000:0:0:0:0:0:0:0/3"
APP_KEY: ${APP_KEY}
PASSPORT_PRIVATE_KEY_PATH: /var/www/html/storage/oauth-keys/oauth-private.key
PASSPORT_PUBLIC_KEY_PATH: /var/www/html/storage/oauth-keys/oauth-public.key
SUPER_ADMINS: ${SUPER_ADMINS}
LOG_CHANNEL: stderr_daily
LOG_LEVEL: debug
DB_CONNECTION: pgsql
DB_HOST: database
DB_PORT: 5432
DB_SSLMODE: require
DB_DATABASE: solidtime
DB_USERNAME: solidtime
DB_PASSWORD: randompassword
MAIL_MAILER: smtp
MAIL_HOST: ${MAIL_HOST}
MAIL_PORT: ${MAIL_PORT}
MAIL_ENCRYPTION: tls
MAIL_FROM_ADDRESS: "no-reply@yourdomain.com"
MAIL_FROM_NAME: solidtime
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
QUEUE_CONNECTION: database
FILESYSTEM_DISK: local
PUBLIC_FILESYSTEM_DISK: public
healthcheck:
test: [ "CMD-SHELL", "supervisorctl status worker:worker_00" ]
depends_on:
- database
database:
restart: always
image: 'postgres:15'
environment:
PGPASSWORD: 'randompassword'
POSTGRES_DB: 'solidtime'
POSTGRES_USER: 'solidtime'
POSTGRES_PASSWORD: 'randompassword'
volumes:
- 'database-storage:/var/lib/postgresql/data'
networks:
- internal
healthcheck:
test:
- CMD
- pg_isready
- '-q'
- '-d'
- 'solidtime'
- '-U'
- 'solidtime'
retries: 3
timeout: 5s
networks:
internal:
volumes:
database-storage:
app-storage:
and my .env
APP_KEY=""
PASSPORT_PRIVATE_KEY_PATH=/var/www/html/storage/oauth-keys/oauth-private.key
PASSPORT_PUBLIC_KEY_PATH=/var/www/html/storage/oauth-keys/oauth-public.key
SUPER_ADMINS=
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=yourmail.gmail.com
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
CLOUDFLARE_TUNNEL_TOKEN=
Hi, I'm installing solidtime in docker (Portainer). The application is installed, database migrate, it shows up, I get to register, I get the confirmation email, that link works... all good. But, when I enter the application, none of the front end calls to the backend works, they all give the following error.
Note: Since I'm using Portainer, I entered all the variables in portainer, which creates a stack.env file for it, so I changed the docker compose entries to use stack.env instead of laravel.env (just in case this affects something wired up)
The configuration of the keys looks something like this: