Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Website hosted in docker container is not updating live

I am developping a website which I want to host inside a php-apache docker container.
I use the following command to run the container:

docker run -dit --restart unless-stopped --name my_www -p 8080:80 -v /path/to/repo:/var/www/html/ php:7.4-apache

Since I bind the repository containing the code as a volume to the container, I expect the website to "update live" when I change the code locally. I had this right behaviour last time I tried but I am now unable to get it back.
When I check the website locally at 127.0.0.1 everything is ok and changes are taken into account normaly, but they do not propagate into the docker container... For some reason, the files in the docker are stuck to an old version of the code, an old "stat" of the repository...
Any ideas how I can manage to fix this and preview changes live ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Credits to @Don't Panic for helping to debug.
The browser was caching everything so I couldn't see changes live.
The solution was to enable the "expires" apache module inside the docker container:

$ docker exec -it <container_id> bash
root@<container_id>:# a2enmod expires
root@<container_id>:# exit
$ docker restart my_www

Et voilà :)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!