Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davijp7/dockerfy

A simplified, improvised and improved laradock project based docker setup
https://github.com/davijp7/dockerfy

devops docker elasticsearch mariadb mysql nginx php portainer portainer-ce

Last synced: about 17 hours ago
JSON representation

A simplified, improvised and improved laradock project based docker setup

Awesome Lists containing this project

README

        


Dockerfy

DOCKERFY



# FIRST STEP
### Create a .env file with environment variables
```bash
cp .env.example .env
```

# SECOND STEP
### Run the command below to create and startup the container(s)
```bash
docker compose up -d
```

# CONGRATULATIONS 🎉




# TRICKS & TIPES 🎩
### To run a command inside the container, use the command below
```bash
docker compose exec
```

### To access the container's shell, use the command below
```bash
docker compose exec sh
```

### To stop the container(s), use the command below
```bash
docker compose down
```

# Docker Control Script 🐳

## Overview

This script allows you to manage Docker containers easily. You can start containers with specified options or stop them with a simple command.

## Usage

### Running the Script

You can run the script with the following commands:

```bash
./script.sh [on|off] [-c=]

```

### Arguments

- `on`: Starts the specified Docker containers.
- `off`: Stops all running Docker containers.
- `-c=`: Specifies which containers to start. If this flag is not provided, default containers will be used.

### Default Containers

If you run the script with on without the -c flag, the following containers will be started by default:

- `nginx`
- `mysql`
- `php-fpm`
- `php-worker`
- `portainer`
- `proxy`
- `workspace`

### Example Commands


  1. Start default containers:
  2. ```bash
    ./script.sh on
    ```

  3. Start specified containers:


  4. ```bash
    ./script.sh on -c=nginx,php
    ```

  5. Stop all containers:
  6. ```bash
    ./script.sh off -c=nginx,php
    ```

### Requirements

- Docker
- Docker Compose

### Notes

- Ensure that your `docker-compose.yml` file is properly configured to support the containers you want to start.

- The script uses `eval` to execute the generated Docker command, so please be cautious with the input values.

- Try using an alias to make it easier to run the script in any directory. 😉