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]: Crater Invoice Docker database connection error #11

Closed
pektasmustafa opened this issue Sep 23, 2022 · 3 comments
Closed

[Bug]: Crater Invoice Docker database connection error #11

pektasmustafa opened this issue Sep 23, 2022 · 3 comments
Assignees

Comments

@pektasmustafa
Copy link

Hi, crater docker is very nice. But there is a problem. It does not accept database information on the url/install page. I get the following error. So I checked the .env file, everything seems correct. Thank you in advance for your help!

SQLSTATE[HY000] [1045] Access denied for user 'crater'@'172.18.0.6' (using password: YES)

Note: I couldn't find your Crater Invoice project here, but I was able to follow it from hub.docker.com.

@shinsenter
Copy link
Owner

@pektasmustafa
Can I have your setup (docker-compose.yml)?

@pektasmustafa
Copy link
Author

Hi again, thank you for the quick reply. You can see the file below. I installed it with portainer and I can give you access if you want.

version: '3'

services:
app:
build:
args:
user: crater-user
uid: 1000
context: ./
dockerfile: Dockerfile
image: crater-php
restart: unless-stopped
working_dir: /var/www/
volumes:
- ./:/var/www
- ./docker-compose/php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini:rw,delegated
networks:
- crater

db:
image: mariadb
restart: always
volumes:
- db:/var/lib/mysql
# If you want to persist data on the host, comment the line above this one...
# and uncomment the line under this one.
#- ./docker-compose/db/data:/var/lib/mysql:rw,delegated
environment:
MYSQL_USER: crater
MYSQL_PASSWORD: crater
MYSQL_DATABASE: crater
MYSQL_ROOT_PASSWORD: crater
ports:
- '33006:3306'
networks:
- crater

nginx:
image: nginx:1.17-alpine
restart: unless-stopped
ports:
- 80:80
volumes:
- ./:/var/www
- ./docker-compose/nginx:/etc/nginx/conf.d/
networks:
- crater

cron:
build:
context: ./
dockerfile: ./docker-compose/cron.dockerfile
volumes:
- ./:/var/www
networks:
- crater

volumes:
db:

networks:
crater:
driver: bridge

@shinsenter
Copy link
Owner

shinsenter commented Sep 25, 2022

@pektasmustafa
I think the problem is the mounting point is incorrect. The application should be placed in /var/www/html inside the container (your path is /var/www).

Please read the document and my working examples for the Crater image at https://hub.docker.com/r/shinsenter/crater

The Crater image is built on top of my PHP base image. To modify PHP settings, I recommend using Docker environment variables instead of mouting the PHP config files. View more: https://hub.docker.com/r/shinsenter/php

Btw, the Crater docker image is a standalone service, so the extra nginx service is not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants