Giter VIP home page Giter VIP logo

devstack's Introduction

DevStack

Great LAMP devstack based on Docker & Docker Compose for your home programming.

Docker Stars Docker Pulls

Discussion / Help

Join the chat

LAMP

  • Apache 2.4.x
  • PHP 7.2.x + Composer + PHPMailer
  • PHP 5.6.x + Composer + PHPMailer
  • NodeJS 8.x + NPM 5.x
  • MariaDB 10.1
  • PostgreSQL 9.6
  • Adminer 4.3.x

Install

  1. Download devstack binary script.

    wget https://raw.githubusercontent.com/dockette/devstack/master/devstack
    wget https://raw.githubusercontent.com/dockette/devstack/master/docker-compose.yml
    
  2. Setup devstack variables in your .profile or .bashrc.

    These values are default!

    • DEVSTACK_DOCKER=~/.devstack/docker-compose.yml (docker compose file)
    • DEVSTACK_PREFIX=devstack (container's prefix)
    • DEVSTACK_USER=dfx (attached user in container) [you can leave it]
  3. Make devstack managing script executable.

    chmod +x devstack
  4. Create symlink to /usr/local/bin/devstack or to other bin path.

    ln -s ~/devstack /usr/local/bin/devstack

Configuration

Ports

Container Ports IP
Apache 80 / 443 172.10.10.5
PHP 7.2 + FPM 172.10.10.10
PHP 5.6 + FPM 172.10.10.11
NodeJS 172.10.10.12
Adminer 8000 172.10.10.13
MariaDB 3306 172.10.10.20
PostgreSQL 5432 172.10.10.21

Docker Compose (docker-compose.yml)

I have prepared docker configuration file for you. You can download it here.

wget https://raw.githubusercontent.com/dockette/devstack/master/docker-compose.yml

If you didn't change the DEVSTACK_DOCKER variable, you should place your docker-compose.yml file to your user's folder ~/.devstack/docker-compose.yml.

After you've followed install section, your devstack should be well prepared. One thing left, you should configure your devstack (passwords, folders, etc).

You should:

Userdirs

There are two kind of users inside these containers, root (main unix user) and dfx (special user with uid 1000 in all dockette based images).

You can find it in docker-compose.yml file in section/container.

On the containers startup, your users dir are attached to php72, php56, nodejs containers. You can create your own .bash_profile, .bashrc files for easier manipulation inside docker containers.

[TIP] There used to be a skeleton in ubuntu/debian/mint system.

cp /etc/skel/.bashrc <path-to-dfx-userdir>/.bashrc

PHP

PHP container provides a few environment variables you can override:

xdebug

Key Value
PHP_IDE_CONFIG serverName=devstack.webserver
XDEBUG_CONFIG idekey=PHPSTORM

phpmailer

Phpmailer stores all mails send via mail() function to /srv/mail folder by default. You can change it.

Key Value
PHPMAILER_PATH /srv/mail

MySQL / MariaDB

MariaDB's default root password is root. You should change it.

You have to setup in you application/configs proper host which is mariadb.

MariaDB container has predefined IP address 172.10.10.20.

172.10.10.20 mariadb

PostgreSQL

PostgreSQL's default root password is root. You should change it.

You have to setup in you application/configs proper host which is postgresql.

PostgreSQL container has predefined IP address 172.10.10.21. You could update your /etc/hosts.

172.10.10.21 postgresql

Adminer

Adminer is great tool for managing database. Dockette devstack runs Adminer on port 8000.

See more on documentation at https://github.com/dockette/adminer.

Hosts

By default is devstack available on domains:

You should add these lines to your /etc/hosts file.

# Devstack [webserver]
127.0.0.1 local.dev
127.0.0.1 www.local.dev
127.0.0.1 local.dev7
127.0.0.1 www.local.dev7
127.0.0.1 local.dev56
127.0.0.1 www.local.dev56

# Devstack [DB]
172.10.10.20 mariadb
172.10.10.21 postgresql

Give a try!

ping local.dev
ping local.dev56
ping local.dev7
ping mariadb
ping postgresql

Thank you for testing, reporting and contributing.

devstack's People

Contributors

f3l1x avatar freezy-sk avatar landsman avatar matyx avatar vanam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devstack's Issues

Sloupce a řádky v bash

Neřešil jsi tento problém?
Když vstoupím do bash containeru, tak se nebindují sloupce dle šířky okna terminálu. Tzn pak při středně dlouhém commandu přepisuji začátek řádku, jako kdybych použil nějaký insert. Je to otravné.

Test - moje OS:

$ tput cols
175
$ tput lines
46

Container:

$ devstack gu php72
dfx@7ef16fc8ede1:/srv$ tput cols
80
dfx@7ef16fc8ede1:/srv$ tput lines
24

Děje se mi to pokud mám otevřených více terminálů v tabech. Pokud pozavírám ostatní a nechám pouze jeden s exec do containeru, nabindují se správné env variables.

Screenshoty:
screenshot from 2018-07-15 11-57-37
screenshot from 2018-07-15 12-00-59

upgrade docker-compose na v3

@f3l1x nezvazujes upgrade docker-compose na v3?
umoznilo by to pouzivat premenne v definicii portov
nevyhodou je ze by bolo treba prerobit volumes_from lebo v3 neumoznuje zdielanie volume zo services ale len z volumes definovanych na najvyssej urovni compose file

Readme: wrong PHP 5.6 hosts URL

I think local URLs mentioned in readme (hosts section) for PHP 5 versions are wrong right? It should be local.dev56 instead of local.dev5.

Manual

Hi,

could you please state some examples in the readme on how to get a web application up and running (e.g. Nette sandbox)? I tried but could not get it working. My top success was to get a blank directory listing from Apache when loading one of stated domains in the browser.

Here is my setup:

  • changed content of ~/projects/docker-devstack/devstack is
    COMPOSE=docker-compose.yml
    other is the same
  • devstack command in my bin
  • ~/projects/sandbox/docker-compose.yml copied from yours and changed the following (other is the same)
    data:
      image: busybox
    
      volumes:
        - ./src:/srv
    
  • ~/projects/sandbox/src/ is the directory with Nette sandbox
  • I get the mentioned result when running the devstack up in the directory with project ~/projects/sandbox/docker-compose.yml

Thank you in advance.

Adminer maybe not working

Hi, everything works except Adminer. This is not big deal for me, but maybe its bug and you are interested in :-)

I'm not sure how this should work, but nothing is running on localhost:8000. I'm not sure if something is exposed to this port, see my devstack list result.

        Name                       Command                State                      Ports                   
------------------------------------------------------------------------------------------------------------
devstack_adminer_1      /bin/sh -c /usr/bin/php -S ...   Exit 127                                            
devstack_apache_1       apache2ctl -D FOREGROUND         Up         0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp 
devstack_data_1         sh                               Exit 0                                              
devstack_mariadb_1      docker-entrypoint.sh mysqld      Up         3306/tcp                                 
devstack_nodejs_1       /bin/sh -c /bin/bash             Up                                                  
devstack_php56_1        php-fpm5.6 -F                    Up                                                  
devstack_php7_1         php-fpm7.1 -F                    Up                                                  
devstack_postgresql_1   docker-entrypoint.sh postgres    Up         0.0.0.0:5432->5432/tcp                   
devstack_userdirs_1     sh                               Exit 0  

PS: Maybe you should mention something about Adminer and where its running in README (or just link to dockette/adminer repository should be ok)

PS2: check last version of Adminer (you mention v4.2.5 in README, actual is v4.3.1)

THX for great work anyway ;)

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.