platform/devops/docker/README.md

173 lines
3.6 KiB
Markdown
Raw Normal View History

2024-07-18 23:43:29 +00:00
# Docker Services
2024-07-14 23:35:19 +00:00
2024-07-18 23:43:29 +00:00
The required applications by the framework can be run using the docker compose files provided in this folder.
2022-07-11 06:15:02 +00:00
2024-06-23 03:15:41 +00:00
## PostreSQL
2022-07-11 06:15:02 +00:00
2024-06-23 03:15:41 +00:00
### Starting the PostreSQL container
2022-07-11 06:15:02 +00:00
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-pg.yml -p pg up -d
2024-06-23 03:15:41 +00:00
```
### Stopping the PostreSQL container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-pg.yml -p pg stop
docker compose -f docker-compose-pg.yml -p pg down
2024-06-23 03:15:41 +00:00
```
### Checking the PostreSQL container log
```bash
docker logs docker-pg-1 -f
2022-07-11 06:15:02 +00:00
```
### Running psql
```bash
docker exec -it <container id> /bin/bash
psql --username postgres
```
2024-07-20 02:23:45 +00:00
### Create PostgreSQL database, user and grant access
2022-07-11 06:15:02 +00:00
2024-07-20 02:23:45 +00:00
```sql
create database orm_test;
create user test with encrypted password 'test123';
grant all privileges on database orm_test to test;
2022-07-11 06:15:02 +00:00
```
## MariaDB
2024-06-23 03:15:41 +00:00
### Starting the MariaDB container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-mariadb.yml -p maria up -d
2024-06-23 03:15:41 +00:00
```
### Stopping the MariaDB container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-mariadb.yml -p maria stop
docker compose -f docker-compose-mariadb.yml -p maria down
2024-06-23 03:15:41 +00:00
```
### Checking the MariaDB container log
```bash
2024-07-14 23:35:19 +00:00
docker logs maria-mariadb-1 -f
2024-06-23 03:15:41 +00:00
```
2024-07-20 02:23:45 +00:00
### Create MariaDB database, user and grant access
```sql
create database orm_test;
-- Granting localhost access only
create user 'test'@'localhost' identified by 'test123';
grant all privileges on orm_test.* to 'test'@'localhost';
-- Granting localhost and remote access
create user 'test'@'%' identified by 'test123';
grant all privileges on orm_test.* to 'test'@'%';
```
2022-07-11 06:15:02 +00:00
## MySQL
2024-06-23 03:15:41 +00:00
### Starting the MySQL container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-mysql.yml -p mysql up -d
2024-06-23 03:15:41 +00:00
```
### Stopping the MySQL container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-mysql.yml -p mysql stop
docker compose -f docker-compose-mysql.yml -p mysql down
2024-06-23 03:15:41 +00:00
```
### Checking the MySQL container log
```bash
2024-07-14 23:35:19 +00:00
docker logs mysql-mysql-1 -f
2024-06-23 03:15:41 +00:00
```
2024-07-20 02:23:45 +00:00
### Create MySQL database, user and grant access
```sql
create database orm_test;
-- Granting localhost access only
create user 'test'@'localhost' identified by 'test123';
grant all privileges on orm_test.* to 'test'@'localhost';
-- Granting localhost and remote access
create user 'test'@'%' identified by 'test123';
grant all privileges on orm_test.* to 'test'@'%';
```
2024-06-23 03:15:41 +00:00
## MongoDB
### Starting the MongoDB container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-mongo.yml -p mongo up -d
2024-06-23 03:15:41 +00:00
```
### Stopping the MongoDB container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-mongo.yml -p mongo stop
docker compose -f docker-compose-mongo.yml -p mongo down
2024-06-23 03:15:41 +00:00
```
### Checking the MongoDB container log
```bash
2024-07-14 23:35:19 +00:00
docker logs mongo-mongo-1 -f
2024-06-23 03:15:41 +00:00
```
2024-06-29 09:57:48 +00:00
## rethinkDB
### Starting the rethinkDB container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-rethinkdb.yml -p rethink up -d
2024-06-29 09:57:48 +00:00
```
### Stopping the rethinkDB container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-rethinkdb.yml -p rethink stop
docker compose -f docker-compose-rethinkdb.yml -p rethink down
2024-06-29 09:57:48 +00:00
```
### Checking the rethinkDB container log
```bash
2024-07-14 23:35:19 +00:00
docker logs rethink-rethinkdb-1 -f
2024-06-29 09:57:48 +00:00
```
2022-07-11 06:15:02 +00:00
## Redis
2024-06-23 03:15:41 +00:00
### Starting the Redis container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-redis.yml -p redis up -d
2024-06-23 03:15:41 +00:00
```
### Stopping the Redis container
```bash
2024-07-14 23:35:19 +00:00
docker compose -f docker-compose-redis.yml -p redis stop
docker compose -f docker-compose-redis.yml -p redis down
2024-06-23 03:15:41 +00:00
```
### Checking the Redis container log
```bash
2024-07-14 23:35:19 +00:00
docker logs redis-redis-1 -f
2024-06-23 03:15:41 +00:00
```