Comments (20)
I believe I fixed this. Should be able to specify UID
and GID
environment values in the docker-compose.yml
file. Will set Ampache's internal www-data user to the ID you specify.
from ampache-docker.
Update:
We need to add the following line to run.sh to let PHP write to the config directory:
chown www-data:www-data -R /var/www/config
The install wizard will then tell us that ampache.cfg.php is writable!
But at the step where it generates the config file, it’s giving me this error:
Error: Config files not found or unreadable
Basically it can’t find the template ampache.cfg.php… But the dockerfile doesn’t actually install it?
Am I missing something?
from ampache-docker.
you shouldn't need to do anything special.
If you build with your config file it gets copied over from the dockerfile and then copied on run.
Dockerfile
COPY ampache.cfg.* /var/temp/
run.sh
if [[ -f /var/temp/ampache.cfg.php && ! -f /var/www/config/ampache.cfg.php ]]; then
mv /var/temp/ampache.cfg.php /var/www/config/ampache.cfg.php
fi
from ampache-docker.
If you build with your config file it gets copied over from the dockerfile and then copied on run.
This issue is not about custom build of image, it's about launching a image with mounted volume for configs. Even if i build custom docker container with my dist config - the issue still here - i will get not readable config
you shouldn't need to do anything special.
In most host machines docker www-data GID UID not match with HOST machine GID UID - so when image start and copy config we have bad file permissions 🤷♂️
So i need do many special things to run this image properly.
- i need map host machine user to
www-data
docker user for normal file permissions- read/write config
- read/write media
- read/write podcast downloads
For now i use special entrypoint for docker-compose
#!/usr/bin/env bash
usermod -a -G users www-data #I't work only for my host machine, you need use groups from yours
exec /run.sh
then my config.php becomes readable
from ampache-docker.
@kuzi-moto That works great!
@raaron773 It's PID
and UID
not PGID
and PUID
!
@lachlan-00 I think this can be closed.
from ampache-docker.
@KaeTuuN It's GID and UID
from ampache-docker.
I followed your tip above
chown www-data:www-data -R /var/www/config
Then I got the ampache.cfg.php.dist in the repo and manually put it in the config folder. Then the buttons were then set to OK and was able to proceed.
You can check the run.sh file to see that it moved it over.
mv /var/temp/ampache.cfg.php.dist /var/www/config/ampache.cfg.php.dist
Then everything seems to install okay.
from ampache-docker.
I't bad idea modify files on host machine from docker.
Instead you need use right UID and GID from host machine in image for www-data user.
from ampache-docker.
Here good example of GID and UID setup for docker-containers - https://docs.linuxserver.io
It sad, but another way to map user rights from host machine to docker volumes are full of pain
--user docker options working bad with volumes
from ampache-docker.
I'll test out what you've said and see what I can do.
from ampache-docker.
This worked fine. test.php comes up all readable.
docker run --name=ampache -d -v /mnt/files-music/albums/:/media:ro -v /var/www/config/:/var/www/config/:rw -p 8888:80 ampache/ampache
from ampache-docker.
Can you check in this example /mnt/files-music/albums/
default file permissions?
/mnt/files-music/albums/
- very similar to SMB mount with default 777 permissions
My point has not changed - on host machine we have user www-data
with different UID then internal docker or host machine have no user www-data
.
You can emulate this with usermod -u 3333 www-data
or just try to mount volume with no www-data
owner - then config been nor readable.
from ampache-docker.
That seems like something that's not an issue with the host not the image.
from ampache-docker.
Can you check in this example
/mnt/files-music/albums/
default file permissions?
/mnt/files-music/albums/
- very similar to SMB mount with default 777 permissionsMy point has not changed - on host machine we have user
www-data
with different UID then internal docker or host machine have no userwww-data
.You can emulate this with
usermod -u 3333 www-data
or just try to mount volume with nowww-data
owner - then config been nor readable.
I second that, the approach in this container works if the music folder is used only by ampache or if all other containers use the same UID and GID, but for configurations with many concurrent services (like mine) maybe is not ideal. Using the USER docker directive it's not useful too because the container use root for the database.
from ampache-docker.
@kuzi-moto can you show how to concretely do this?
from ampache-docker.
I will try to remember to do it tomorrow!
from ampache-docker.
I tried adding PGID and PUID in environment section in the docker-compose file. It's the same thing right ? @kuzi-moto because if it is then it didn't work if not then how do I go about this?
EDIT: This is what I did: https://pastebin.com/RKTxP7JN
from ampache-docker.
The warning stays, even though the option seems to work...
from ampache-docker.
I tried adding PGID and PUID in environment section in the docker-compose file. It's the same thing right ? @kuzi-moto because if it is then it didn't work if not then how do I go about this?
EDIT: This is what I did: https://pastebin.com/RKTxP7JN
There is a typo in your file: "enivironment"
from ampache-docker.
@KaeTuuN It's GID and UID
That's what I wrote!?
from ampache-docker.
Related Issues (20)
- Database setup seems to fail on install HOT 1
- MariaDB not starting with ampache:5.6.2 HOT 11
- Web browser not playing songs when using non-standard port HOT 3
- Unable to upgrade to 6.0.1 HOT 3
- Multiple Entries per Song after fresh creation HOT 2
- 6.1.0 Docker Images HOT 2
- Reverse proxy for Apache? HOT 1
- Unable to query the database, check your Ampache config (after first run) HOT 6
- Ampache 6.2.0 docker builds needed HOT 1
- Docker image doesn't run on (older) Synology NAS HOT 10
- Apache2 entered FATAL state, too many start retries too quickly HOT 1
- Support for Docker Rootless mode HOT 2
- Config file outdated - ampache 6.x.x ships config_version 62 HOT 3
- Database fails on Compilation custom metadata tag HOT 3
- Setting web_path results in 404 after setup HOT 6
- ampache/ampache:nosql-preview comes with mariadb installation HOT 3
- [Question] about container configuration HOT 7
- To create volume folders or not to HOT 3
- Issue With Data & Media Directory HOT 2
- Is FFMPEG Transcoding available via the :latest Docker image? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ampache-docker.