2016-06-29 22:06:44 +00:00
Docker RosarioSIS
2015-02-23 19:09:34 +00:00
=================
2016-06-29 22:06:44 +00:00
A Dockerfile that installs the latest [RosarioSIS ](https://www.rosariosis.org/ ). This file pulls from the default branch, but can be easily modified to pull from any other available branch or tagged release.
2015-02-23 19:09:34 +00:00
## Installation
2016-06-29 22:06:44 +00:00
Minimum requirements: [Docker ](https://www.docker.com/ ) & Git working.
2020-08-20 11:11:15 +00:00
You can pull the image from [DockerHub ](https://hub.docker.com/r/rosariosis/rosariosis ) or:
2020-06-12 12:59:58 +00:00
2016-06-29 22:06:44 +00:00
```bash
2022-03-07 20:35:51 +00:00
git clone https://gitlab.com/francoisjacquet/docker-rosariosis.git
cd docker-rosariosis
2022-03-08 09:30:29 +00:00
docker build -t rosariosis .
2015-02-23 19:09:34 +00:00
```
## Usage
2016-06-29 18:18:01 +00:00
RosarioSIS uses a PostgreSQL database:
2016-06-29 22:06:44 +00:00
```bash
2022-03-08 09:30:29 +00:00
docker run --name rosariosisdb -e "POSTGRES_PASSWORD=postgrespwd" -d postgres
2019-09-23 13:37:31 +00:00
```
2022-03-07 20:35:51 +00:00
Create database:
2019-09-23 13:37:31 +00:00
```bash
2022-03-08 09:30:29 +00:00
docker exec -it rosariosisdb bash
2022-03-07 20:35:51 +00:00
psql -h localhost -p 5432 -U postgres
2019-09-23 13:37:31 +00:00
postgres=# CREATE USER rosario WITH PASSWORD 'rosariopwd';
postgres=# CREATE DATABASE rosariosis WITH ENCODING 'UTF8' OWNER rosario;
postgres=# \q
2022-03-07 20:35:51 +00:00
exit
```
2022-03-07 20:54:14 +00:00
Run RosarioSIS (DockerHub image) and link the PostgreSQL container:
2022-03-07 20:35:51 +00:00
```bash
2022-03-08 09:30:29 +00:00
docker run -e "ROSARIOSIS_ADMIN_EMAIL=admin@example.com" -e "PGHOST=rosariosisdb" -h `hostname -f` -d -p 80:80 --name rosariosis --link rosariosisdb:rosariosisdb rosariosis/rosariosis:master
2015-02-23 19:09:34 +00:00
```
2022-03-07 20:35:51 +00:00
Port 80 will be exposed, so you can visit http://localhost/InstallDatabase.php to get started. Default username and password: `admin` .
2015-05-18 04:51:46 +00:00
2019-09-22 19:49:31 +00:00
Note: a `docker-compose.yml` file is available.
2022-03-08 09:30:29 +00:00
Note 2: you may have to add `sudo` before the `docker` command.
2019-09-22 19:49:31 +00:00
## Environment Variables
2017-09-23 03:19:02 +00:00
The RosarioSIS image uses several environment variables which are easy to miss. While none of the variables are required, they may significantly aid you in using the image.
### PGHOST
2020-08-20 11:11:15 +00:00
Host of the postgres database.
2017-09-23 03:19:02 +00:00
### PGUSER
2020-08-20 11:11:15 +00:00
This optional environment variable is used in conjunction with PGPASSWORD to set a user and its password for the database.
2017-09-23 03:19:02 +00:00
### PGPASSWORD
2020-08-20 11:11:15 +00:00
This optional environment variable is used in conjunction with PGUSER to set a user and its password for the database.
2017-09-23 03:19:02 +00:00
### PGDATABASE
2020-08-20 11:11:15 +00:00
This optional environment variable can be used to define a different name for the database.
2017-09-23 03:19:02 +00:00
### PGPORT
2020-08-20 11:11:15 +00:00
This optional environment variable can be used to define a different port for the database.
2017-09-23 03:19:02 +00:00
### ROSARIOSIS_YEAR
2020-08-20 11:11:15 +00:00
This optional environment variable can be used to define the default school year in RosarioSIS settings.
2017-09-23 03:19:02 +00:00
2022-03-07 20:53:00 +00:00
### ROSARIOSIS_ADMIN_EMAIL
This optional environment variable can be used to define an email address where to send error and new administrator notifications.
2017-09-23 03:19:02 +00:00
### ROSARIOSIS_LANG
2020-08-20 11:11:15 +00:00
This optional environment variable is for RosarioSIS to show another language.
2017-09-23 03:19:02 +00:00
2022-03-07 20:35:51 +00:00
Values are `fr_FR` for French and `es_ES` for Spanish.
You must also generate the `fr_FR.utf8` (for example) locale. To do so run these commands:
```bash
sudo docker exec -it rosariosis bash
dpkg-reconfigure locales
```
2017-09-23 03:19:02 +00:00
### ROSARIOSIS_VERSION
2020-08-20 11:11:15 +00:00
This optional environment variable is used to set the required version of RosarioSIS.
2017-09-23 03:19:02 +00:00
2015-05-18 04:51:46 +00:00
## SMTP
2022-02-19 11:44:12 +00:00
RosarioSIS will attempt to send mail via the host's port 25. In order for this to work you must set the hostname of the rosariosis container to that of `host` (or some other hostname that can appear on a legal `FROM` line) and configure the host to accept SMTP from the container. For postfix this means adding the container IP addresses to `/etc/postfix/main.cf` as in:
2015-05-18 04:51:46 +00:00
2016-06-29 20:52:46 +00:00
```
2015-05-18 04:51:46 +00:00
mynetworks = 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
2016-06-29 20:52:46 +00:00
```
2015-05-18 04:51:46 +00:00
2020-08-20 11:13:50 +00:00
Note: alternatively, you can use the [Email SMTP ](https://www.rosariosis.org/plugins/email-smtp/ ) plugin for RosarioSIS.
2022-05-07 10:04:47 +00:00
## Additional configuration
[Quick Setup Guide ](https://www.rosariosis.org/quick-setup-guide/ )
[Secure RosarioSIS ](https://gitlab.com/francoisjacquet/rosariosis/-/wikis/Secure-RosarioSIS )