Skip to content

Project skeleton repository including environment powered on Docker

Notifications You must be signed in to change notification settings

kuflievskiy/docker-project-skeleton

Repository files navigation

Instructions.

Install docker and docker-compose.

sudo apt-get install docker docker-compose -y

In order to build the env for this project from scratch,

Remove the containers, images, volume from the local machine.

You can clear all the docker stuff: containers, images and it's data using these commands:

sudo docker rm $(sudo docker stop $(sudo docker ps -a -q)) && \
sudo docker rmi $(sudo docker images -q) && \
sudo docker volume rm $(sudo docker volume ls -q)

Add your user to docker group:

sudo usermod -aG docker $USER

Then just use:

docker rm $(docker stop $(docker ps -a -q)) && \
docker rmi $(docker images -q) && \
docker volume rm $(docker volume ls -q)

Configure sSMTP connection via Google SMTP (Optional).

cp docker/webserver/etc/ssmtp/ssmtp.conf.sample docker/webserver/etc/ssmtp/ssmtp.conf
vim docker/webserver/etc/ssmtp/ssmtp.conf

Build images & run the containers.

docker-compose -f docker-compose-php73.yml up -d --build
docker-compose -f docker-compose-php74.yml up -d --build
docker-compose -f docker-compose-php80.yml up -d --build

# how to use local UID & GID via docker-compose container "args" and pass them into the container
# this approach requires to uncomment the appropriate sections inside the docker-compose file & Dockerfile also.
LOCAL_UID="$(id -u)" LOCAL_GID="$(id -g)" LOCAL_USER="$USER" docker-compose -f docker-compose-php80.yml up -d --build

Access the site by URL.

Login into the container if need to apply some changes to the server configuration.

sudo docker exec -it container_webserver bin/bash
sudo docker exec -it container_dbhost bin/bash

Get the list of active processes inside the container which listen to some port.

apt-get update
apt-get install -y net-tools
netstat -an|grep LISTEN

Install the site (Drupal/Wordpress)

docker exec container_webserver wordpress.sh
http://localhost:8080/
http://localhost:8080/wp-login.php
admin
admin

docker exec container_webserver drupal.sh
http://localhost:8080/

About

Project skeleton repository including environment powered on Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published