pull/6/head
Sævar Öfjörð Magnússon 2020-01-24 15:26:51 +00:00
rodzic e97a344e16
commit 13f31a490c
1 zmienionych plików z 93 dodań i 2 usunięć

Wyświetl plik

@ -1,4 +1,95 @@
# docker-wagtail-develop
docker-wagtail-develop
======================
A script to painlessly set up a Docker environment for development of Wagtail - inspired by [vagrant-wagtail-develop](https://github.com/wagtail/vagrant-wagtail-develop)
Initial work in Bristol sprint January 2020 by [esperk](https://github.com/esperk) and [saevarom](https://github.com/saevarom).
Setup
-----
**Requirements:** [Docker](https://www.docker.com/) and Docker Compose (Docker Compose is included with Docker Desktop for Mac and Windows).
Open a terminal and follow those instructions:
```sh
# 1. Decide where to put the project. We use "~/Development" in our examples.
cd ~/Development
# 2. Clone the docker-wagtail-develop repository in a new "wagtail-dev" folder.
git clone git@github.com:saevarom/docker-wagtail-develop.git wagtail-dev
# 3. Move inside the new folder.
cd wagtail-dev/
# 4. Run the setup script. This will check out all the dependency repos.
./setup.sh
# 5. Build the containers
docker-compose build
```
It can take a while (typically 15-20 minutes) to fetch and build all dependencies and containers.
Here is the resulting folder structure:
```sh
.
├── libs # Supporting libraries to develop Wagtail against.
├── wagtail # Wagtail repository / codebase.
└── bakerydemo # Wagtail Bakery project used for development.
```
Once setup is over,
```sh
# 5. Start your container setup
docker-compose up
# Success!
```
- Visit your site at http://localhost:8000
- The admin interface is at http://localhost:8000/admin/ - log in with `admin` / `changeme`.
What you can do
---------------
See a list of running containers
```sh
$ docker-compose ps
Name Command State Ports
---------------------------------------------------------------------------------------------------
docker-wagtail-develop_db_1 docker-entrypoint.sh postgres Up 5432/tcp
docker-wagtail-develop_frontend_1 /bin/sh -c cp -r /node_mod ... Up
docker-wagtail-develop_web_1 /bin/bash -c cd /code/wagt ... Up 0.0.0.0:8000->8000/tcp
```
You can open a django shell session
```sh
docker exec -it docker-wagtail-develop_web_1 python manage.py shell
```
You can open a shell on the web server
```sh
docker exec -it docker-wagtail-develop_web_1 bash
```
Getting ready to contribute
---------------------------
Here are other actions you will likely need to do to make your first contribution to the project.
Set up git remotes to Wagtail forks (run these lines outside of the Vagrant VM):
```sh
cd ~/Development/wagtail-dev/wagtail
# Change the default origin remote to point to your fork.
git remote set-url origin git@github.com:<USERNAME>/wagtail.git
# Add wagtail/wagtail as the "upstream" remote.
git remote add upstream git@github.com:wagtail/wagtail.git
# Pull latest changes from all remotes / forks.
git pull --all
```
A script to painlessly set up a Docker environment for development of Wagtail.