this project for my skripsi.
First step is to generate self-signed certificates. The easiest method is to use mkcert
command. Check instructions on how to install mkcert
.
mkdir certs && cd $_ && mkcert docker.localhost "*.docker.localhost" && cd ..
There will be two .pem
files generated stored in certs
folder. This will be used by traefik later on.
Alternatively, you can can use openssl
command:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
However, this method requires extra step in order for the SSL to work properly in your browser. A well detailed instruction is provided here.
Keep in mind, generating the certificates is a one time process only since website will be hosted in subdomain. Depending on your needs and structure, you can still opt to generate as many certificates as you want, just replace the default domain (docker.localhost) in docker-compose.yml
and config-staging.toml
. Replace the new 2 named .pem
files in the config-staging.toml
as well.
You would then need to create a network beforehand:
docker network create sdbayes-local
Run traefik-compose.yml
first:
docker-compose -f traefik-compose.yml up -d
Check by visting https://traefik.docker.localhost/dashboard/.
Next is to modify any configuratioin in sdbayes-compose.yml
and then run:
docker-compose -f sdbayes-compose.yml up
Having problems?
- Make sure the database service name is unique.
- Subdomain name is unique.
- The network is the same for every new wordpress instance.
$ pip install -r requirements.txt
$ mv example.environment prod.env
$ python manage.py recreate_db
atau
$ docker-compose run --rm sdbayes_web sh -c "python manage.py recreate_db"
$ python manage.py import_dev
atau
$ docker-compose run --rm sdbayes_web sh -c "python manage.py import_dev"
$ source env/bin/activate
$ honcho start -e config.env -f Local
Before you submit changes to flask-base, you may want to autoformat your code with python manage.py format
.
Contributions are welcome! Please refer to our Code of Conduct for more information.