Adding Docker guide in a different document.

This commit is contained in:
Sergiotarxz 2023-07-01 05:23:06 +02:00
parent 93a28819a7
commit 028ab2e0c3
2 changed files with 87 additions and 81 deletions

View File

@ -7,87 +7,9 @@ this project.
## Docker
Docker is the recommended way for novices to
test this software, to use it first you
are going to have to install a bunch of packages
in the host.
### Install Docker deps in the Host.
```shell
sudo apt update && \
sudo apt install docker.io redis postgresql pwgen
```
### Configure Redis in the Host for Docker
Now you are going to have to reconfigure
redis to use unix sockets that you can share
with redis.
```shell
( cat << 'EOF'
unixsocket /var/run/redis/redis.sock
unixsocketperm 777
EOF
) | sudo tee -a /etc/redis/redis.conf && \
sudo systemctl restart redis
```
### Setup the database in the Host.
```shell
( cat << EOF
create user $(whoami);
create database "las_tres";
grant all privileges on database "las_tres" to $(whoami);
alter database "las_tres" owner to $(whoami);
EOF
) | sudo -u postgres psql
```
### Exec the webpage using Docker.
```shell
bash start_docker.sh
```
The first time you execute this the database migrations
won't be applied but we are going to solve this soon.
As soon as the application is already listening open
a new terminal and execute the following command to install
the database migrations.
```shell
bash install_docker.sh
```
It is very important that all the docker actions are
done when the container is started otherwise they
will throw error and do nothing.
After the install interrupt `start_docker.sh` with
control + c and start it again and the database
installation will be complete.
### Creating new migrations.
```shell
bash prepare_docker.sh
```
### Upgrading the database with the new migrations.
```shell
bash upgrade_docker.sh
```
### Where are the CSS and Javascript build scripts for Docker?
These scripts are not needed in Docker since Docker already
does them every time you start the container, caring about
changes in the Perl dependencies is also unneeded, Docker
already cares for you.
Do you want a fast and easy way to get started?
Visit the [Docker Guide](DOCKER.md), if you
want to install the project native continue here.
## Installing native.

84
DOCKER.md Normal file
View File

@ -0,0 +1,84 @@
# Get started with Docker.
Docker is the recommended way for novices to
test this software, to use it first you
are going to have to install a bunch of packages
in the host.
## Install Docker deps in the Host.
```shell
sudo apt update && \
sudo apt install docker.io redis postgresql pwgen
```
## Configure Redis in the Host for Docker
Now you are going to have to reconfigure
redis to use unix sockets that you can share
with redis.
```shell
( cat << 'EOF'
unixsocket /var/run/redis/redis.sock
unixsocketperm 777
EOF
) | sudo tee -a /etc/redis/redis.conf && \
sudo systemctl restart redis
```
## Setup the database in the Host.
```shell
( cat << EOF
create user $(whoami);
create database "las_tres";
grant all privileges on database "las_tres" to $(whoami);
alter database "las_tres" owner to $(whoami);
EOF
) | sudo -u postgres psql
```
## Exec the webpage using Docker.
```shell
bash start_docker.sh
```
The first time you execute this the database migrations
won't be applied but we are going to solve this soon.
As soon as the application is already listening open
a new terminal and execute the following command to install
the database migrations.
```shell
bash install_docker.sh
```
It is very important that all the docker actions are
done when the container is started otherwise they
will throw error and do nothing.
After the install interrupt `start_docker.sh` with
control + c and start it again and the database
installation will be complete.
## Creating new migrations.
```shell
bash prepare_docker.sh
```
## Upgrading the database with the new migrations.
```shell
bash upgrade_docker.sh
```
## Where are the CSS and Javascript build scripts for Docker?
These scripts are not needed in Docker since Docker already
does them every time you start the container, caring about
changes in the Perl dependencies is also unneeded, Docker
already cares for you.