Skip to content

Commit

Permalink
Merge pull request #45 from nevadskiy/feature/multistage-dockerfile
Browse files Browse the repository at this point in the history
Compose V2 + Multi-stage builds + Traefik
  • Loading branch information
xalaida authored Jan 7, 2024
2 parents 4b03ac4 + f61c5a7 commit e6227b4
Show file tree
Hide file tree
Showing 110 changed files with 963 additions and 3,515 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: ["https://buymeacoffee.com/nevadskiy"]
File renamed without changes
98 changes: 21 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,47 @@

# Dockerized template for your next project with Laravel and Nuxt

Well tested on Ubuntu 18.04, 19.10 and 20.04.

## 🍬 Stack includes
## 🍬 Stack

* API
* Laravel (latest version)
* Octane / PHP-FPM
* PostgreSQL (and separate database for testing)
* Laravel (latest version) + Octane server
* PostgreSQL
* Redis
* MailHog
* Client
* Nuxt 2 / 3 (latest version)
* Gateway
* Nginx (as reverse-proxy)
* Certbot

## 📜 Introduction

The project is just separate pre-configured Laravel and Nuxt applications that are stored in the same [monorepo](https://en.wikipedia.org/wiki/Monorepo).

Each app has its docker templates for development and production and does not have the actual application code.
So you can install and run them completely separately from each other.
There are also no restrictions to adding more, for example, a mobile or an admin panel application.
* Mailpit
* Minio
* WEB
* Nuxt (latest version)
* Reverse proxy
* Traefik

## ⚙ Installation

Clone or download the repository and enter its directory:

```bash
git clone https://github.com/nevadskiy/laravel-nuxt-docker.git app
cd app
```

### API

#### Quick installation

```bash
cd api
./install
```

This will install and run a fresh new Laravel app which will be available on `http://localhost:8000`.

#### Advanced installation

Read more about an [advanced API installation](./api/DOCUMENTATION.md).

### Client

#### Quick installation
Clone or download the repository:

```bash
cd client
./install
git clone https://github.com/nevadskiy/laravel-nuxt-docker.git
```

This will install and run a fresh new Nuxt 3 app which will be available on `http://localhost:3000`.

#### Advanced installation

Read more about an [advanced client installation](./client/DOCUMENTATION.md).

### Gateway (optional)

#### Single host

If you want to host API and client apps on the single host machine, you may set up subdomains rather than rely on published ports.

The project includes a simple gateway application that can easily help with this.

It can also be useful to run locally and set up an application to use subdomains and test CORS and other possible issues.

If you want to deploy your project using the "single host" approach, install the `gateway` application according to [its documentation](./gateway/README.md).
Otherwise, you can safely delete it.
For local development you can ignore it completely.

Of course, you can replace it with a more professional tool, like [Traefik](https://traefik.io).
Install [API](api/README.md), [WEB](web/README.md), and [reverse-proxy](reverse-proxy/README.md) (optionally for local development) using their installation instructions.

## 🔌 Network communication

The following image demonstrates the request paths in a local development environment.

![Networking](docs/networking.png)
![Networking](.github/img/networking.png)

API and WEB requests sent by the browser are proxied directly via published ports to the running server instances.

But the SSR request is sent by the node server, not the browser, and should be sent directly to the host of the API docker service.

## 📑 Documentation

- [API](./api/DOCUMENTATION.md)
- [Client](./client/DOCUMENTATION.md)
- [Gateway](./gateway/README.md)
- [Deployment](./docs/DEPLOYMENT.md)
For production environment it is recommended to configure a Reverse Proxy Server that will handle all incoming requests.

## ☕ Contributing

If you see anything that can be improved, feel free to make a pull request.
Contributions are welcome and will be fully credited.
If you see anything that can be improved, feel free to make a pull request. Contributions are welcome and will be fully credited.

## Support the Project

If you find this project helpful or just want to show your appreciation, consider buying me a coffee. Your support helps in maintaining and improving this project.

[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-%23FFDD00.svg?&style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://buymeacoffee.com/nevadskiy)
40 changes: 0 additions & 40 deletions api/.docker/dev/app/Dockerfile

This file was deleted.

44 changes: 0 additions & 44 deletions api/.docker/dev/base/Dockerfile

This file was deleted.

30 changes: 0 additions & 30 deletions api/.docker/dev/base/conf.d/opcache.ini

This file was deleted.

10 changes: 0 additions & 10 deletions api/.docker/dev/base/php.ini

This file was deleted.

2 changes: 0 additions & 2 deletions api/.docker/dev/mailhog/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions api/.docker/dev/postgres/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions api/.docker/dev/postgres/dumps/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions api/.docker/dev/queue/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions api/.docker/dev/redis/Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions api/.docker/dev/schedule/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions api/.docker/dev/schedule/cron.d/crontab

This file was deleted.

27 changes: 0 additions & 27 deletions api/.docker/prod/app/Dockerfile

This file was deleted.

Loading

0 comments on commit e6227b4

Please sign in to comment.