Important! Please read!
The repository contains the
settings.phpfile with the database credentials. This should NEVER be done with real-life projects.(Also the
sites/default/filesdirectory is under version control. This is probably also not a good idea in non-demo projects)
The backend is built using docker4drupal (Visit project documentation)
You need to have the following dependencies installed:
dockercomposerdocker-composeon Linux
-
Go into the
./backenddirectory:$ cd backend -
Install backend dependencies:
$ cd htdocs && composer install --ignore-platform-reqs && cd ..
-
Start local development server (You will probably have to wait a minute, because importing the database can take a while. Before this is complete you will see an
The website encountered an unexpected error. Please try again later.error.):$ docker-compose up -d
-
Clean the cache
$ docker-compose exec php drush cr -r /var/www/html/htdocs/web -
You can access the backend by pointing your browser to http://dc2018-react-backend.docker.localhost/ – The login details are:
admin/admin123 -
Point the app to use the local backend by changing the property
apiBaseinpackage.jsonto the above URL.
Persist database changes (will be imported on next docker-compose up -d:
# In ./backend/
$ ./persist-db.sh$ docker-compose down