Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL certificate, error. #109

Closed
comeback01 opened this issue Oct 8, 2023 · 1 comment
Closed

SSL certificate, error. #109

comeback01 opened this issue Oct 8, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@comeback01
Copy link

Hello,

I wanted to use port 80, and put an SSL certificate on port 443.

Here's how I modified the file ocker-compose.yml:

version: '3.9'

services:
  dialoqbase:
    image: n4z3m/dialoqbase:latest
    container_name: dialoqbase
    restart: unless-stopped
    ports:
      - 80:3000
      - 443:443
    environment:
      DATABASE_URL: postgres://postgres:postgres@dialoqbase-pg:5432/dialoqbase?connection_limit=15&pool_timeout=0
      DB_REDIS_URL: redis://redis:6379
    env_file:
      - .env
    depends_on:
      - dialoqbase-pg
      - redis
    volumes:
      - .uploads:/app/uploads
      - ./letsencrypt:/etc/letsencrypt
      - ./lib/letsencrypt:/var/lib/letsencrypt

  dialoqbase-pg:
    image: ankane/pgvector:latest
    container_name: dialoqbase-postgres
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: dialoqbase
    volumes:
      - .postgres:/var/lib/postgresql/data

  redis:
    image: redis:latest
    container_name: redis
    restart: unless-stopped
    volumes:
      - .redis:/data

  certbot:
    image: certbot/certbot
    container_name: certbot
    volumes:
      - ./letsencrypt:/etc/letsencrypt
      - ./lib/letsencrypt:/var/lib/letsencrypt
    entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"

Then I ran the following commands:

docker-compose down
docker run -it --rm --name certbot -v "$(pwd)/letsencrypt:/etc/letsencrypt" -v "$(pwd)/lib/letsencrypt:/var/lib/letsencrypt" -p 80:80 certbot/certbot certonly --standalone -d bot.hd1.ch --email your-comeback01@gmail.com --agree-tos --no-eff-email
docker-compose up -d

docker logs dialoqbase

yarn run v1.22.19
$ npx prisma migrate deploy && fastify start  app.js
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "dialoqbase", schema "public" at "dialoqbase-pg:5432"

14 migrations found in prisma/migrations


No pending migrations to apply.
npm notice
npm notice New major version of npm available! 9.8.1 -> 10.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.0>
npm notice Run `npm install -g npm@10.2.0` to update!
npm notice
Connecting integration...
Connecting to database...

Thank you for your help

@n4ze3m
Copy link
Owner

n4ze3m commented Oct 8, 2023

Hey, can you try this example? https://gist.github.com/dahlsailrunner/679e6dec5fd769f30bce90447ae80081 (setting up SSL and nginx proxy on an API). I'm sorry, but I'm unable to assist right now. I will comment here tomorrow if that link fails. Sorry

@n4ze3m n4ze3m added the documentation Improvements or additions to documentation label Oct 8, 2023
@n4ze3m n4ze3m closed this as completed Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants