Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: drupal site doesnt survive a restart #227

Open
jhjacobs81 opened this issue Oct 23, 2022 · 1 comment
Open

docker: drupal site doesnt survive a restart #227

jhjacobs81 opened this issue Oct 23, 2022 · 1 comment

Comments

@jhjacobs81
Copy link

Hello,

i use this docker image to run a container from: https://hub.docker.com/_/drupal
i have then run this command: docker run --rm drupal tar -cC /var/www/html/sites . | tar -xC /path/on/host/sites and mounted it as /var/www/html/sites

However, when the container gets restarted, it shows the installation page instead of the site with its content.

Does anyone know what i do wrong? I would expect the site returns to its normal status as there's site specific data in the sites folder thats beeing mounted.

here is my docker-compose file for completeness:

 version: '3'

services:

  drupal:
    container_name: <CONTAINERNAME>
    image: drupal:9.3-php8.0
    ports:
      - 8081:80
    volumes:
      - ./modules:/var/www/html/modules
      - ./profiles:/var/www/html/profiles
      - ./themes:/var/www/html/themes
      - ./sites:/var/www/html/sites
    restart: always
    networks:
      - drupal-network

  postgres:
    image: postgres:11
    container_name: <CONTAINERNAME>
    environment:
      POSTGRES_PASSWORD: <PASSWORD>
      POSTGRES_DB: drupal
      POSTGRES_USER: drupal
    restart: always
    networks:
      - drupal-network

networks:
    default:
        driver: bridge
    drupal-network:
        external: true

## EXECUTE THIS COMMAND FIRST: docker run --rm -v /opt/docker/drupal/sites:/temporary/sites drupal cp -aRT /var/www/html/sites /temporary/sites
@jhjacobs81 jhjacobs81 changed the title docker container doesnt survive a restart docker: drupal site doesnt survive a restart Oct 23, 2022
@tianon
Copy link
Member

tianon commented Dec 19, 2023

There might be some good ideas in #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants