dockette/devstack

Sponsored OSS

By dockette

Updated almost 6 years ago

My LAMP/Devstack Dockerfile

Image
Languages & frameworks
Web servers
Databases & storage
6

8.0K

dockette/devstack repository overview

Dockette / DevStack

GitHub Actions Docker Hub pulls GitHub Sponsors Support/Discussions

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

LAMP

Optional services are prepared in docker-compose.yml, but are commented out until you enable them:

  • NodeJS 24.x (latest LTS) + NPM
  • PostgreSQL 18

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]
    • DEVSTACK_COMPOSE (optional compose command override; defaults to docker compose with docker-compose fallback)

    The compose file mounts your SSH agent into containers, so SSH_AUTH_SOCK should point to a running SSH agent socket. If you do not use agent forwarding, the devstack script uses /tmp/devstack-ssh-agent as a fallback; override it with DEVSTACK_SSH_AUTH_SOCK if needed.

  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
ContainerPortsIP
Apache80 / 443172.10.10.5
PHP 8.5 + FPM172.10.10.10
NodeJS (optional)172.10.10.12
Adminer8000172.10.10.13
MariaDB3306172.10.10.20
PostgreSQL (optional)5432172.10.10.21
Docker Compose (docker-compose.yml)

I have prepared docker configuration file for you. You can download it here. The project uses the Docker Compose plugin command (docker compose) and keeps a legacy docker-compose fallback for older hosts.

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 php85 and to nodejs when you enable that optional container. 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
KeyValue
PHP_IDE_CONFIGserverName=devstack.webserver
XDEBUG_CONFIGidekey=PHPSTORM
phpmailer

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

KeyValue
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 (optional)

If you enable PostgreSQL, its 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.dev8
127.0.0.1 www.local.dev8

# Devstack [DB]
172.10.10.20 mariadb
# Optional PostgreSQL
172.10.10.21 postgresql

Give a try!

ping local.dev
ping local.dev8
ping mariadb

# Optional services
ping postgresql

Maintenance

See how to contribute to this package. Consider to support f3l1x. Thank you for using this package.

Tag summary

Content type

Image

Digest

Size

172.6 MB

Last updated

almost 6 years ago

docker pull dockette/devstack:php56

This week's pulls

Pulls:

71

Last week