Lanuch AWS Instance. I'm using a t3.large with 50GB disk drive using the Linux AMI 2 OS. Make sure you have public DNS turned on (https://stackoverflow.com/questions/20941704/ec2-instance-has-no-public-dns)
SSH to the instance
ssh -i ~/.ssh/YOURKEY.pem ec2-user@[YOUR PUBLIC DNS]
Update system
sudo yum update
Install docker, docker compose
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chkconfig docker on
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo reboot
Add ports 80, 8282 and 9191 to your AWS aloowed ports
Download the docker-compose YML file (this one is modified to help you, get the orginal from the wikibase docker git repo)
wget https://gist.githubusercontent.com/thisismattmiller/44af3ee3f8143a80b443f5e38e0a44d0/raw/f1688ebc20c81df055892f8fd263d4e57cf466df/docker-compose.yml
nano docker-compose.yml
Go through and make changes to where there are [BRACKETS] for your info, mostly DNS hostname
docker-compose up
Will take a few min.
Try loading your site at your AWS Public Hostname address, like "ec2-54-166-137-158.compute-1.amazonaws.com"
Try to log in to the admin account, goto [YourDNSHostName]:9191 to setup the quick statements
Try creating a new property, add statments, text out port :8282 to make sure the query service works.
Open a new ssh connection, we are going to get the LocalSettings.php file from the container and modify it.
type:
docker ps
To get a list of all the running containers, look for the alphanumeric ID for the container "wikibase/wikibase:1.34-bundle" would look something like "d26ae1241260"
Run
docker cp CONTAINERID:/var/www/html/LocalSettings.php ./LocalSettings.php
Now you can modify the LocalSettings.php to disable account creation and anon editing by aadding these to it:
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
You can also customize the logo with a new image, by adding an image to replace it:
wget https://thisismattmiller.s3.amazonaws.com/ld4p.png
Edit the docker-compose.yml file to enable these new files to overwrite the ones in the container: in the file:
- ./LocalSettings.php:/var/www/html/LocalSettings.php
- ./ld4p.png:/var/www/html/resources/assets/wiki.png
Control-C to stop the running service in the other connection. And restart it
docker-compose up -d
To run it in the background
If you ever mess up or need to change the URL or something else like that you can wipe out the current data with
docker rm $(docker ps -a -f status=exited -q)
docker volume rm $(docker volume ls -qf dangling=true)
This will remove all data.