writefreely/docker-setup.sh
Rob Loranger 34b5581026
finish updating dockerfile and compose
this simplifies the compose file a bit, makes the dockerfile more
efficient and reintroduces the setup script that works with the new
image.

also adds a default 'bind' of 0.0.0.0 to the server block in
config.ini.example.
2019-09-16 13:06:23 -07:00

23 lines
No EOL
733 B
Bash
Executable file

#! /bin/bash
# this script will configure and intialize the persitent data needed
# for a writefreely instance using the docker-compose.yml in this repo
# start database
docker run -d --volume=writefreely_db-data:/var/lib/mysql \
--name=db \
-e "MYSQL_DATABASE=writefreely" \
-e "MYSQL_ROOT_PASSWORD=changeme" \
-p 3306:3306 \
mariadb:latest
# create new asset signing keys
docker run --volume=writefreely_web-data:/home/writefreely writeas/writefreely:latest "-gen-keys"
# generate new configuration and initialize database
docker run -it --volume=writefreely_web-data:/home/writefreely \
--link db:db \
writeas/writefreely:latest "-config"
# clean up detached database container
docker container stop db
docker container rm db