Does the Docker installation still rotate logs?

I just checked a recent install and can confirm we are indeed rotating.

The log rotations depends on a few things:

First and foremost, being on a recent image.

This is how you can find what you are on:

cd /var/discourse
git pull
nano launcher

Look for this line in launcher discourse_docker/launcher at master · discourse/discourse_docker · GitHub

eg:

image=discourse/discourse:1.3.10

Then compare to the image you are running:

./launcher enter app
cat /VERSION
1.3.10

If you are an old image, do this ASAP:

cd /var/discourse
./launcher rebuild app

Make sure you have /var/log mounted to host

Our sample template contains the lines:

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

This says that /var/log in the container will be mounted at /var/discourse/shared/standalone/log/var-log

If this is missing, add it asap we expect the logs to live outside of the container, not inside it.

How our log rotation is configured?

Our web template contains this info

  - file:
     path: /etc/logrotate.d/nginx
     contents: |
        /var/log/nginx/*.log {
          daily
          missingok
          rotate 14
          compress
          delaycompress
          notifempty
          create 0640 www-data www-data
          sharedscripts
          postrotate
            sv 1 nginx
          endscript

Once a day we rotate logs for NGINX and compress old logs.

The image runs cron (actually anacron on boot and then cron which is a bit better)

./launcher enter app
ps aux | grep cron

root        48  0.0  0.0   4244   764 ?        Ss   May04   0:00 runsv cron
root        51  0.0  0.0  29300  2956 ?        S    May04   0:01 cron -f

cron runs logrotate daily in /etc/cron.daily

cat /var/log/syslog.1
May 17 07:30:01 server anacron[13014]: Will run job `cron.daily' in 5 min.
May 17 07:35:01 server  anacron[13014]: Job `cron.daily' started
May 17 07:35:01 server  anacron[13359]: Updated timestamp for job `cron.daily' to 2017-05-17
May 17 07:52:41 server  anacron[13014]: Job `cron.daily' terminated


So yeah, this is all working but you may need a rebuild and you may need to add the missing share.