Skip to content
/ laravel-nuxt-docker Public template

🦾 Dockerized template for your next project with Laravel and Nuxt.

Notifications You must be signed in to change notification settings

xalaida/laravel-nuxt-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stand With Ukraine

Dockerized template for your next project with Laravel and Nuxt

Well tested on Ubuntu 18.04, 19.10 and 20.04.

Stack includes

  • API
    • Laravel (latest version)
    • Octane
    • PostgreSQL (and separate database for testing)
    • Redis
    • MailHog
  • Client
    • Nuxt 3 (latest version)
  • Gateway
    • Nginx (as reverse-proxy)
    • Certbot

Introduction

The project is just separate preconfigured Laravel and Nuxt applications that are stored in the same monorepo.

Each app has its own docker templates for development and production and does not have the actual application code. So you can install and run them completely separate from each other. There are also no restrictions to add more, for example, a mobile application or an admin panel.

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.

Of course, you can replace it with a more professional tool.

Installation

  1. Clone or download the repository with its submodules and enter its directory:
git clone --recurse-submodules https://github.com/nevadskiy/laravel-nuxt-docker.git app
cd app
  1. Install the api application.
cd api
./install.sh

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

  1. Install the client application.
cd client
./install.sh

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

  1. (Optional) If you want to deploy your project using single host approach, install the gateway application according to its documentation. Otherwise, you can safely delete it.

Network communication

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

Networking

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

To Do

  • add gateway submodule and instructions how to clone with it and pull updates
  • add gateway conf templates and add possibility to fill them according to the ENV variables
  • try to set up CI/CD using GitHub actions