caddy-docker icon indicating copy to clipboard operation
caddy-docker copied to clipboard

files 10 and access.log are created on container start

Open OmgImAlexis opened this issue 8 years ago • 3 comments

I'm not sure where this issue is from but I noticed when loading my Caddyfile using this container I get 2 files created in my /srv directory called 10 and access.log.

Here's my Caddyfile.

0.0.0.0:2015 {
    gzip
    log /logs/requests.log {
    	rotate_size 50  # Rotate after 50 MB
    	rotate_age  90  # Keep rotated files for 90 days
    	rotate_keep 10  # Keep at most 10 log files
    	rotate_compress # Compress rotated log files in gzip format
    }
    errors /logs/errors.log {
    	rotate_size 50  # Rotate after 50 MB
    	rotate_age  90  # Keep rotated files for 90 days
    	rotate_keep 10  # Keep at most 10 log files
    	rotate_compress # Compress rotated log files in gzip format
    }
    fastcgi / 127.0.0.1:9000 php # php variant only
    startup php-fpm7 & # php variant only
}

After running this the files appear in $(pwd)/root/sites/user123/example.com/www.

docker run -d \
   -p 2015:2015 \
   -v $(pwd)/.caddy/php/Caddyfile:/etc/Caddyfile \
   -v $(pwd)/root/sites/user123/example.com/www:/srv \
   -v $(pwd)/root/sites/user123/example.com/logs:/logs \
   --name=example.com \
   abiosoft/caddy:php

OmgImAlexis avatar Jul 28 '17 14:07 OmgImAlexis

Are you certain you're overriding the default Caddyfile?

dwin avatar Aug 03 '17 17:08 dwin

Yep mounted my file over /etc/Caddyfile.

OmgImAlexis avatar Aug 04 '17 00:08 OmgImAlexis

I'll see if I can recreate the issue. I have my logs writing to /srv/site.com/, but my structure is different. I'm using:/www/site.com/public, for content with logs at /www/site.com/. So my run command just contains -v /var/www:/srv to expose the volume.

dwin avatar Aug 04 '17 02:08 dwin