The setup scripts to create development environments for many groups.
The configuration is done via a TSV file (config/students.tsv). Here is its format:
| Lastname | Firstname | Group | Github | Image1 | Team1 | Image2 | Team2 | Comment | |
|---|---|---|---|---|---|---|---|---|---|
| Bon | Jean | [email protected] | INF3 | jeanjean | Laravel | ninjas | Rails | funky | - |
| Blanc | Yoan | [email protected] | Teacher | greut | Laravel | admin | Python | admin | - |
This is how this file is used:
To download the public keys, run this python script:
# setup
$ virtualenv3 .
$ . bin/activate
$ pip3 install -r requirements.txt
$ scripts/github_keys.py config/students.tsv config/keys/ <github_username> <password_or_key>
The key is a personal access token to avoid being rate limited by the API.
Based on the same TSV file, you can generate docker-compose.yml file.
$ scripts/rails_compose.py config/students.tsv docker-compose.yml
$ script/bdd.py docker-compose.yml
If you don't want to use the publicly available containers, you can build them yourself.
# Base container
$ docker-compose -f build.yml build base
# Laravel container
$ docker-compose -f build.yml build laravel
# Python container
$ docker-compose -f build.yml build python
# Rails container
$ docker-compose -f build.yml build rails
$ docker run -d \
-v `pwd`/config \
-p 80 \
greut/webapp-server
Create a docker-compose.yml file base on the sample one.
Run the container(s)
docker-compose up -d
The databases are open the external world, hence we must modify the super admin password. Setting up a good one during the startup won't be as effective as it will be visible from within the containers anyway.
Changing MySQL root password because the above value will be passed to each linked containers.
# 5.6
$ mysqladmin -h 127.0.0.1 -u root -p'root' password 's3cur3@P45sw0rd'
# 5.7
$ mysql -h 127.0.0.1 -u root -proot
> SET PASSWORD FOR 'root'@'%' = PASSWORD('s3cur3@P45sw0rd');
Changing Postgres password because the above value will be passed to each linked containers.
$ psql -h 127.0.0.1 \
-U postgres \
-c "ALTER USER postgres WITH PASSWORD 's3cur3@P45sw0rd';"
Content type
Image
Digest
sha256:5412f5d3e…
Size
303.2 MB
Last updated
over 9 years ago
docker pull greut/webapp-server