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] <title>How to connect database in a same docker network. #104

Closed
1 task done
wswv opened this issue Nov 14, 2024 · 2 comments
Closed
1 task done

[BUG] <title>How to connect database in a same docker network. #104

wswv opened this issue Nov 14, 2024 · 2 comments

Comments

@wswv
Copy link

wswv commented Nov 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I tried to use the nginx as PHP runtime enviroument, I put the mybb in ngix docker directory "www", everything is fine, but when I tried to access dababase(used mariadb in a same docker network) following mybb installation process, it reports can't connect to database. there is no guidance or document how to configure the nginx docker to access database which outside the nginx docker. I'm not sure this is a right place to talk it here. but hope someone could help to support to solve it.

Expected Behavior

the PHP application below nginx docker could access docker database in a same docker network.

Steps To Reproduce

N/A right now

Environment

- OS:debian 12
- How docker service was installed:
docker and docker compose following guidance of docker official site

CPU architecture

x86-64

Docker creation

---
services:
  nginx:
    image: lscr.io/linuxserver/nginx:latest
    container_name: nginx
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /path/to/nginx/config:/config
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped
	
  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD
      - MYSQL_DATABASE=USER_DB_NAME #optional
      - MYSQL_USER=MYSQL_USER #optional
      - MYSQL_PASSWORD=DATABASE_PASSWORD #optional
      - REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql #optional
    volumes:
      - /path/to/mariadb/config:/config
    ports:
      - 3306:3306
    restart: unless-stopped

Container logs

N/A right now
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@j0nnymoe
Copy link
Member

Nothing to do with nginx. You'll be telling the web app to either use to help container name or your servers host IP.

@j0nnymoe j0nnymoe closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants