Browse Source

Run Weasyprint from docker-compose on localdev

pull/170/head
Michael Olund 5 years ago
parent
commit
4202338491
3 changed files with 12 additions and 15 deletions
  1. +2
    -14
      README.md
  2. +9
    -0
      docker-compose.yml
  3. +1
    -1
      edivorce/settings/local.py

+ 2
- 14
README.md View File

@ -38,23 +38,11 @@ To run this project in your development machine, follow these steps:
`python3.6 ./manage.py runserver 0.0.0.0:8000`
8. Start the [Weasyprint server](https://hub.docker.com/r/aquavitae/weasyprint/) server on port 5005
1. Bind the IP address 10.200.10.1 to the lo0 interface on your Mac computer. Weasyprint has been configured to use this IP address to request CSS files from Django.
```
sudo ifconfig lo0 alias 10.200.10.1/24
```
1. Start docker
```
docker run -d -p 5005:5001 aquavitae/weasyprint
```
9. Start up docker containers:
8. Start up docker containers:
`docker-compose up -d`
10. Open your browser and go to http://127.0.0.1:8000, you will be greeted with the eDivorce homepage. In dev mode, you can log in with any username and the password 'divorce'.
9. Open your browser and go to http://127.0.0.1:8000, you will be greeted with the eDivorce homepage. In dev mode, you can log in with any username and the password 'divorce'.
### SCSS Compilation


+ 9
- 0
docker-compose.yml View File

@ -34,5 +34,14 @@ services:
ports:
- "8082:8081"
# Weasyprint (PDF generator)
weasyprint:
container_name: edivorce-weasyprint
hostname: weasyprint
image: aquavitae/weasyprint
ports:
- "5005:5001"
restart: always
volumes:
data-redis:

+ 1
- 1
edivorce/settings/local.py View File

@ -17,7 +17,7 @@ SESSION_COOKIE_AGE = 3600
TEMPLATES[0]["OPTIONS"]["debug"] = True
WEASYPRINT_URL = 'http://localhost:5005'
WEASYPRINT_CSS_LOOPBACK = 'http://10.200.10.1:8000'
WEASYPRINT_CSS_LOOPBACK = 'http://host.docker.internal:8000'
DEPLOYMENT_TYPE = 'localdev'
REGISTER_URL = '#'


Loading…
Cancel
Save