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

bug: Use docker-compose to build and access the public network ip to localhost #6705

Open
1 of 4 tasks
moseszane168 opened this issue Oct 21, 2024 · 6 comments
Open
1 of 4 tasks
Assignees
Labels
bug Something isn't working pending-verification Something is still under investigation

Comments

@moseszane168
Copy link

moseszane168 commented Oct 21, 2024

Describe the bug

I deployed logto through docker-compose on the cloud server. After deployment, I accessed logto through the public IP and redirected directly to 'http://localhost:3010/unknown-session'.

Expected behavior

Normally redirect to ‘http://publicnetworkIP:3011/sign-in’.

How to reproduce?

docker and postgreSQL.
docker-compose.yml:

version: "3.8"
services:
  logto:
    restart: always
    depends_on:
      logtoPostgres:
        condition: service_healthy
    image: svhd/logto:1.18.0
    entrypoint: ["sh", "-c", "npm run cli db seed -- --swe && npm start"]
    ports:
      - 3010:3010
      - 3011:3011
    environment:
      - TRUST_PROXY_HEADER=1
      - DB_URL=postgres://postgres:p0stgr3s@logtoPostgres:5432/logto
      # Mandatory for GitPod to map host env to the container, thus GitPod can dynamically configure the public URL of Logto;
      # Or, you can leverage it for local testing.
      - PORT=3010
      - ADMIN_PORT=3011
      - ENDPOINT
      - ADMIN_ENDPOINT
  logtoPostgres:
    restart: always
    image: postgres:14-alpine
    user: root
    volumes:
      - "./.volumes/logto_db:/var/lib/postgresql/data"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: p0stgr3s
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5
volumes:
  data:
    driver: local

Context

  • Logto Cloud
  • Self-hosted, Logto version =
    • Container (Docker image)
    • Raw Node.js

Screenshots

Docker container:
image

Browser Input:
image

Redirect directly to this page:
image

@moseszane168 moseszane168 added the bug Something isn't working label Oct 21, 2024
@wangsijie wangsijie self-assigned this Oct 22, 2024
@wangsijie wangsijie added the pending-verification Something is still under investigation label Oct 22, 2024
@wangsijie
Copy link
Contributor

I'll take a look, does it work on the default ports?

@moseszane168
Copy link
Author

I'll take a look, does it work on the default ports?

3011 3010

@moseszane168
Copy link
Author

how's it going?

@moseszane168
Copy link
Author

I'll take a look, does it work on the default ports?
yes

@wangsijie
Copy link
Contributor

Hi @moseszane168, I'll take a look soon.

@moseszane168
Copy link
Author

Hi @moseszane168, I'll take a look soon.

okay, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending-verification Something is still under investigation
Development

No branches or pull requests

2 participants