Skip to content

eiguss/docker-skeleton-nginx-php7.3-slim4-nuxt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker skeleton for nginx, slim4 (PHP7) and nuxt

Node npm php nuxt slim License: MIT

Docker services

This project have three services:

  1. nginx: load balancer
  2. php: docker wher we will have the server code
  3. node: dockeer where we will generate the assets for the app

Installation

You need to have doker in you computer to install it. To run the dockers execute:

# docker up with install
make du-i

This will make available a nuxt dev server in localhost:3000 to develop the frontend application, this is a hotreloading to make easy the development.

PHP will run in localhost:8080. The PHP docker will get the static nuxt HTML getting the static assets if they generated, to generate it execute:

make node-build

This script will generate the assets with the html and move them to the server folder.

Usage

The folder /server have the php code using slim4 for more information about this framework go to https://www.slimframework.com/docs/v4/. The code in the skeleton is to have a /api endpoint that the frontend will call.

The folder /node have the nuxt code. For more information about this framework go to https://nuxtjs.org/

Test

In the php and node docker we have a folder to make the tests called "/tests". The test are prepared to be executed using:

make test

The php coverage will be available in http://localhost:8080/coverage/index.html