Code Monkey home page Code Monkey logo

docker-phalcon's Introduction

Docker Phalcon

Container for docker and Phalcon development.

Getting Started

This repo contains a implementation of micro application writen with Phalcon, for more information see the tree bellow

Clone the repo and be sure to have installed the prerequisites software, after that be sure to have the docker service up and running

Prerequisites

Folders structure

docker-phalcon
├── code
│   ├── .htaccess
│   ├── index.php # Micro Phalcon Application
│   ├── phpinfo.php # This is an internal file and it's not exposed through nginx
├── dockers
│   ├── phalcon
│   │   ├── Dockerfile # Custom build image for phalcon based on php:7.2-fpm
└── nginx
    ├── conf.d
    │   └── default.conf # Config file for nginx
    └── logs
        └── access.log # logs for nginx access
        └── error.log # logs for nginx errors

How to up the server

Be sure to be located inside the cloned folder, then run

$ docker-compose build
$ docker-compose up -d

Once you see a message like the one bellow open you browser and go to localhost:9999

Creating php ... done
Creating nginx ... done
Attaching to php, nginx

Now you can start playing, these are the endpoints and parameters expected for the micro phalcon app:

Method Endpoint Body parameters Description
GET / - Returns a welcome message
GET /say/hello/{name: String} - Given a name returns a salute and your IP address
POST /store/something name: String Given a name returns a salute

If you want to kill the container you must run

$ docker-compose down

How to run code inside a container

Let's say you want to run some code inside php container, in order to access to bash inside that container you need to run:

$ docker exec -it php bash

Note: Make sure php container is up and running before run this command, otherwise it's going to fail

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.