fix : mount /var/www as /mnt/apps, fix docker socket GID for www-data
- Mount host /var/www into /mnt/apps to avoid conflict with container /var/www/html - Use GID 987 (host docker group) instead of 999 for socket access - Add group_add in docker-compose for container-level GID Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -75,10 +75,8 @@ RUN echo "APP_ENV=prod" > /var/www/html/.env
|
||||
RUN mkdir -p /var/www/html/var/log /var/www/html/var/uploads \
|
||||
&& chown -R www-data:www-data /var/www/html/var
|
||||
|
||||
# Allow www-data to use Docker socket
|
||||
# The socket GID varies per host; we set it at container startup via entrypoint
|
||||
# As fallback, install docker group with common GID
|
||||
RUN groupadd -g 999 docker 2>/dev/null; usermod -aG docker www-data
|
||||
# Allow www-data to use Docker socket (GID 987 matches host's docker group)
|
||||
RUN groupadd -g 987 dockerhost 2>/dev/null; usermod -aG dockerhost www-data
|
||||
|
||||
WORKDIR /var/www/html
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user