0

I currently have a codebase for Drupal using Drupal-VM vagrant box and VirtualBox. I would like to migrate to docker but I am unaware on how to integrate it with my existing code base.

Can anyone help me? I have followed instructions from Docker Hub - Drupal Install Steps and MySQL and Drupal Container to spin up mysql and Drupal images but how do I make it point to my pre-existing codebase?


Previous posts with more Details, Questions and Background:

B. Cratty
  • 1,725
  • 1
  • 17
  • 32

1 Answers1

-1

after spinning up the docker container you can copy the existing code to the container using docker cp docker cp docs

as far as the database you can just import it to the mysql container

to link the container to a volume use the -v flag when starting the container

Callum
  • 52
  • 1
  • 7
  • Im unsure on what you mean. Can you provide the steps so that I can try it on my end to see if it works or not? – B. Cratty Dec 04 '20 at 22:46
  • for me i would create a container using ```docker run --name [container name] --link [mysql container]:mysql -v [volume name]:/var/www -dit drupal``` then from the host you can copy your existing files to the container with ```docker cp [site-dir] [container name]:/var/www``` – Callum Dec 05 '20 at 00:27
  • You may have to do some nginx/apache config within the container to make sure that it points to the new files correctly – Callum Dec 05 '20 at 00:30