Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ can be enabled based on Environment file (.env)! Supports multiple domains.

## The directory structure

For using your projects with this, you should arrange your projects structure as follows,
For using your projects with this, by default you should arrange your projects structure as follows,
```
| application
|- site1
Expand All @@ -18,6 +18,13 @@ For using your projects with this, you should arrange your projects structure as
|- .....
| localhost (this repository)
```
But the project structure is flexible. If wanna change the directory of your projects (set other custom path instead of
same level application directory), just change/add the `PROJECT_DIR` in `.env` file, which should point to your project directory.

```dotenv
PROJECT_DIR=../path/to/your/projects/directory # supports relative/absolute path
```

Now lets look into the localhost structure for where your configuration files should be.

```
Expand Down Expand Up @@ -64,7 +71,7 @@ Checkout the .env.example file for example. To further understand these keep rea
### 1. Sync the system user
Sync the internal docker user with the system user using the environment variable `UID`. In case of linux you can get this
using `id -u` command which is the UID of current user. In case of windows, you can get with same command if you use [cmder
terminal](https://github.com/cmderdev/cmder).
terminal](https://github.com/cmderdev/cmder) or git-bash.

```dotenv
UID=1000
Expand All @@ -91,7 +98,7 @@ COMPOSE_PROFILES=nginx,postgresql
Select the PHP version using the environment variable `PHP_VERSION`. Supports single PHP version.

```dotenv
PHP_VERSION=8.2
PHP_VERSION=8.3
```

### 4. PHP extensions
Expand Down Expand Up @@ -205,7 +212,7 @@ _** If you have any other docker container running with the same name as of this
- Certificate(s) will be generated directly inside the `configuration/ssl` directory
- usage: `cert site1.internal site2.com *.site3.com .....`

In windows, it is recommended to use [cmder terminal](https://github.com/cmderdev/cmder) for better experience.
In windows, it is recommended to use [cmder terminal](https://github.com/cmderdev/cmder) or git-bash for better experience.

## Server Tools
Well, you can use these tools to help you out. We have created a list of them below. These tools can help you do several things.
Expand All @@ -230,6 +237,5 @@ This container mounts your application directory as `/app` inside the container.
- `git-story` # Animated Git story generator (check `git-story -h` for command details)

## ToDo
- Supportive tools
- Tunnel support
- SupervisorD
- SupervisorD with PHP
2 changes: 2 additions & 0 deletions configuration/php/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
1 change: 0 additions & 1 deletion configuration/php/php.ini

This file was deleted.

6 changes: 5 additions & 1 deletion cruise
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ fi

find "${directory}/configuration/apache/" -type f -name "*.conf" -exec cp -ua {} "${directory}/docker/conf/docker-files/apache/" \;

if [ ! -f "${directory}/configuration/php/php.ini" ]; then
touch "${directory}/configuration/php/php.ini"
fi

case "$1" in
up)
docker compose --project-directory "$directory" -f docker/compose/docker-compose.yml up
Expand All @@ -37,7 +41,7 @@ case "$1" in
;;
rebuild)
docker compose --project-directory "$directory" -f docker/compose/docker-compose.yml down
docker compose --project-directory "$directory" -f docker/compose/docker-compose.yml build --no-cache --pull $@
docker compose --project-directory "$directory" -f docker/compose/docker-compose.yml build --no-cache --pull $2 $3 $4 $5 $6 $7 $8 $9
;;
core)
docker exec -it Core bash -c "sudo -u devuser /bin/bash"
Expand Down
6 changes: 5 additions & 1 deletion cruise.bat
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ for /r "%directory%\configuration\apache\" %%f in (*.conf) do (
)
)

if not exist "%directory%\configuration\php\php.ini" (
type nul > "%directory%\configuration\php\php.ini"
)

if "%1" == "start" (
docker compose --project-directory "%directory%" -f docker/compose/docker-compose.yml up -d
) else if %1 == reload (
Expand All @@ -49,7 +53,7 @@ if "%1" == "start" (
docker compose --project-directory "%directory%" -f docker/compose/docker-compose.yml up -d
) else if %1 == rebuild (
docker compose --project-directory "%directory%" -f docker/compose/docker-compose.yml down
docker compose --project-directory "%directory%" -f docker/compose/docker-compose.yml build --no-cache --pull $@
docker compose --project-directory "%directory%" -f docker/compose/docker-compose.yml build --no-cache --pull %2 %3 %4 %5 %6 %7 %8 %9
) else if %1 == core (
docker exec -it Core bash -c "sudo -u devuser /bin/bash"
) else if %1 == lzd (
Expand Down
7 changes: 3 additions & 4 deletions docker/compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.9'
name: cruise
networks:
cruise-net:
Expand All @@ -18,7 +17,7 @@ services:
environment:
- TZ=${TZ:-Asia/Dhaka}
volumes:
- ./../application:/app
- "${PROJECT_DIR:-./../application}:/app"
- ./docker/logs/nginx:/var/log/nginx
- ./configuration/nginx:/etc/nginx/conf.d
- ./configuration/ssl:/etc/ssl/certs:rw
Expand Down Expand Up @@ -48,7 +47,7 @@ services:
env_file:
- "./.env"
volumes:
- ./../application:/app
- "${PROJECT_DIR:-./../application}:/app"
- ./docker/conf/php/php.ini:/usr/local/etc/php/conf.d/99-overrides.ini
- ./docker/conf/php/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
- ./docker/conf/php/openssl.cnf:/etc/ssl/openssl.cnf:rw
Expand Down Expand Up @@ -81,7 +80,7 @@ services:
- "${HTTP_PORT:-80}:80"
- "${HTTPS_PORT:-443}:443"
volumes:
- ./../application:/var/www/html
- "${PROJECT_DIR:-./../application}:/var/www/html"
- ./docker/conf/php/php.ini:/usr/local/etc/php/conf.d/99-overrides.ini
- ./docker/conf/php/openssl.cnf:/etc/ssl/openssl.cnf
- ./configuration/ssl:/etc/apache2/ssl:rw
Expand Down