GithubHelp home page GithubHelp logo

ndrwptrsn / dockerized-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shipping-docker/dockerized-app

0.0 1.0 0.0 171 KB

Example repository for Dockerizing Your Application preview module

PHP 88.80% Shell 3.93% JavaScript 1.39% ApacheConf 0.68% Vue 0.69% HTML 4.51%

dockerized-app's Introduction

Dockerizing Your Application

This is an example repository of a "Dockerized" application, as covered on the Dockerizing Your Application preview series from shippingdocker.com.

Try It Out

# Get repo
git clone https://github.com/shipping-docker/dockerized-app.git
cd dockerized-app

# Build app/node images
./develop build

# Get laravel requirements
./develop composer install
./develop npm install

# Spin up Laravel (defaults to binding to port 80)
./develop up -d
# Alternatively, bind to port 8888 (or any other port)
APP_PORT=8888 ./develop up -d

# Run tests
./develop test

You may need to create a .env file with the following modified from the .env.example file (don't forget to also run ./develop art key:generate):

APP_KEY=SOME-KEY-HERE

DB_HOST=mysql

CACHE_DRIVER=redis
SESSION_DRIVER=redis

REDIS_HOST=redis

Features

  1. Docker Compose configuration for dev vs ci environments
  2. develop helper to run commands against your application, and to more easily use docker-compose
  3. Dynamically decide to load xDebug module based on APP_ENV
  4. Environment considerations for running within CI (e.g. Jenkins)
  5. Docker builds for app container (Nginx+PHP+composer), node contaienr (npm, node, suitable for gulp)

develop Helper

The develop command helper provides the following commands:

Artisan

art command

Run artisan commands within an app container.

./develop art [...]

# e.g.
./develop art make:controller -h

Composer

composer command

Run composer command within an app container.

./develop composer [...]

# e.g.
./develop composer require predis/predis

Test

test command

Run phpunit command within an app container.

./develop test [...]

# e.g.
./develop test
./develop test tests/unit/SpecificFileToTest.php
./develop test --filter 'TestNamespace\\TestCaseClass::testMethod'

Run phpunit command within an already-running app container. This is quicker as it uses exec to run a command inside a running container, instead of run to spin up a new container.

./develop t [...]

# e.g.
./develop t
./develop t tests/unit/SpecificFileToTest.php
./develop t --filter 'TestNamespace\\TestCaseClass::testMethod'

NPM

npm command

Run npm commands within a node container.

./develop npm [...]

# e.g.
./develop npm install
./develop npm install --save gulp

Gulp

gulp command

Run gulp commands within a node container.

./develop gulp [...]

# e.g.
./develop gulp
./develop gulp --production

Docker Compose

docker-compose command

Any command not matching above falls back to running docker-compose.

./develop [...]

# e.g.
./develop ps
./develop up -d
./develop down
./develop exec app bash
./develop run --rm -w /var/www/html app bash

dockerized-app's People

Contributors

fideloper avatar michielgerritsen avatar julientant avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.