Add sudo before the docker command, move to note

This commit is contained in:
François Jacquet 2022-03-08 10:30:29 +01:00
parent 7f745c5f0c
commit 1254bf5dcb

View File

@ -12,19 +12,19 @@ You can pull the image from [DockerHub](https://hub.docker.com/r/rosariosis/rosa
```bash ```bash
git clone https://gitlab.com/francoisjacquet/docker-rosariosis.git git clone https://gitlab.com/francoisjacquet/docker-rosariosis.git
cd docker-rosariosis cd docker-rosariosis
sudo docker build -t rosariosis . docker build -t rosariosis .
``` ```
## Usage ## Usage
RosarioSIS uses a PostgreSQL database: RosarioSIS uses a PostgreSQL database:
```bash ```bash
sudo docker run --name rosariosisdb -e "POSTGRES_PASSWORD=postgrespwd" -d postgres docker run --name rosariosisdb -e "POSTGRES_PASSWORD=postgrespwd" -d postgres
``` ```
Create database: Create database:
```bash ```bash
sudo docker exec -it rosariosisdb bash docker exec -it rosariosisdb bash
psql -h localhost -p 5432 -U postgres psql -h localhost -p 5432 -U postgres
postgres=# CREATE USER rosario WITH PASSWORD 'rosariopwd'; postgres=# CREATE USER rosario WITH PASSWORD 'rosariopwd';
postgres=# CREATE DATABASE rosariosis WITH ENCODING 'UTF8' OWNER rosario; postgres=# CREATE DATABASE rosariosis WITH ENCODING 'UTF8' OWNER rosario;
@ -34,13 +34,15 @@ exit
Run RosarioSIS (DockerHub image) and link the PostgreSQL container: Run RosarioSIS (DockerHub image) and link the PostgreSQL container:
```bash ```bash
sudo 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 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
``` ```
Port 80 will be exposed, so you can visit http://localhost/InstallDatabase.php to get started. Default username and password: `admin`. Port 80 will be exposed, so you can visit http://localhost/InstallDatabase.php to get started. Default username and password: `admin`.
Note: a `docker-compose.yml` file is available. Note: a `docker-compose.yml` file is available.
Note 2: you may have to add `sudo` before the `docker` command.
## Environment Variables ## Environment Variables
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. 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.