Setting the Time Zone for Docker
To change the timezone in Docker, follow these steps:
1. Stop the Docker container
Navigate to the staff/
directory and stop Docker with the command:
sudo ./stop.sh
2. Edit the Dockerfile
Go to the staff/image/
directory and open the Dockerfile.
Find the line that sets the timezone and update it, for example:
ln -f -v -s /usr/share/zoneinfo/America/New_York /etc/localtime ;
Replace America/New_York
with your preferred timezone.
⚠️ Important: In the file data/etc/php.ini
, you must comment out the line with the timezone setting.
Change it from:
date.timezone = Europe/Chisinau
to:
; date.timezone = Europe/Chisinau
3. Rebuild and restart Docker
Return to the staff/
directory and run:
sudo ./start.sh rebuild
4. Set the timezone for the server itself (optional)
If you also want to configure the timezone for the host server, run:
sudo dpkg-reconfigure tzdata