Coder Social home page Coder Social logo

docker-sdk's Introduction

Kilik Docker SDK

Installation instructions to build containers with: nginx php-fpm memcached mysql

requirements:

docker
git
make

install requirements

sudo apt-get install git Make

install docker on debian

sudo apt-get update

sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg2 \
     git \
     software-properties-common \
     make

curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -

sudo apt-key fingerprint 0EBFCD88

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
   $(lsb_release -cs) \
   stable" 

sudo apt-get update

sudo apt-get install docker-ce

sudo docker run -d -p 9900:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /opt/portainer:/data portainer/portainer

You can now access portainer: http://localhost:9900/

install kilik docker sdk

commands:

cd ~
git clone https://github.com/KilikFr/docker-sdk.git docker-sdk

setup your default env (file .env, replace kilik by your login):

// .env file
MYSQL_ROOT_PASSWORD=test
MYSQL_DATABASE=test
MYSQL_USER=test
MYSQL_PASSWORD=test
SCRIPTS=/home/kilik/PhpstormProjects
LOGIN=kilik
HOMEDIR=/home/kilik
UID=1000
GID=1000

add some virtual hosts into sites-enabled:

cp sites.enabled.dist/example.conf sites.enabled/

or create a similar file:

# example.conf (symfony project)
server {
    server_name example.dev;
    root /var/www/sites/example.dev/web;
 
    location / {
        try_files $uri @rewriteapp;
    }
 
    location @rewriteapp {
        rewrite ^(.*)$ /app.php/$1 last;
    }
 
    location ~ ^/(app|app_dev|app_test|config)\.php(/|$) {
        fastcgi_pass php-upstream;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
    }

    error_log /var/log/nginx/example_error.log;
    access_log /var/log/nginx/example_access.log;
}

then, build images:

sudo make build
sudo make up

create your first symfony application:

sudo make php
# now in container
symfony new example.dev
exit
# now in host
# add host
echo "127.0.0.1 example.dev" | sudo tee --append /etc/hosts
# restart front container (nginx) to reload vhosts config
sudo make restart

Now, you can access your new symfony application and phpmyadmin:

docker-sdk's People

Contributors

mitch10593 avatar

Watchers

 avatar  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.