Sign inSign up

jhoncytech/buster-apache

By jhoncytech

•Updated over 4 years ago

Image for development with a simple basic structure

Image
0

1.7K

jhoncytech/buster-apache repository overview

Header Logo

⁠Quick reference

  • Maintained by: Jhoncy Tech - JhonnyGO
⁠Pull command

$ docker pull jhoncytech/buster-apache:b5

⁠Features

This image will help you start any development project with a base structure.
With this structure you get:

⁠Tools, software and packages used
  • Debian 10 -Buster
  • Apache2
  • PHP 8
  • Bootstrap 5
  • Node - npm cli
  • Composer
  • AWS - cli
  • Kubectl
  • Minikube
  • Symfony cli

⁠How to use this image.

⁠Create a Dockerfile in your project

NOTE: use tag depending on bootstrap you need

FROM jhoncytech/buster-apache:b5

COPY ./public-html/ /var/www/html/

CMD apachectl -DFOREGROUND

Then, run the commands to build and run the Docker image:

$ docker build -t my-web .
$ docker run -dit --name my-web-app -p 8080:80 my-web

Visit http://localhost:8080⁠ and you will see It works!

⁠Without a Dockerfile

If you don't want to include a Dockerfile in your project, it is sufficient to do the following:

CONTAINER WITH LINUX OS
$ docker run -dit --name my-web-app -p 8080:80 -v "$PWD":/var/www/html/ jhoncytech/buster-apache:b5
CONTAINER WITH WINDOWS OS
$ docker run -dit --name my-web-app -p 8080:80 -v C:\absolute\path\to\your\windows\folder:/var/www/html/ jhoncytech/buster-apache:b5
⁠Docker Compose

CREATE FILE PHP.INI
Put the file in => volumes/a2-php-ini/php.ini

Get content from here:
Download PHP.INI⁠


CREATE FILE 000-DEFAULT.CONF
Put the file in => volumes/a2-sites-availables/000-default.conf

Get content from here:
Download 000-DEFAULT.CONF⁠


CREATE FILE MYSQL.ENV
Put the file in => conf/mysql.env

MYSQL_ROOT_PASSWORD=123456
MYSQL_DATABASE=jhoncytech
MYSQL_USER=myuser
MYSQL_PASSWORD=654321

CREATE FILE DOCKER-COMPOSE
Put the file in root project

version: '3.9'

########## SERVICES
services:

	########## MYSQL CONTAINER
	jt-mysql:
		container_name: my-mysql
		image: mysql:5.7
		restart: always
		ports:
			- 3306:3306
		env_file: conf/mysql.env
		volumes:
			- ./volumes/mysql:/var/lib/mysql
		networks:
			- jhoncytech

	########## APACHE CONTAINER
	jt-apache:
		container_name: my-apache
		image: jhoncytech/buster-apache:b5
		restart: always
		ports:
			- 8080:80
		volumes:
			- ./volumes/web-project:/var/www/html
			- ./volumes/a2-sites-availables:/etc/apache2/sites-available
			- ./volumes/a2-php-ini:/etc/php
		depends_on:
			- jt-mysql
		networks:
			- jhoncytech


networks:
	- jhoncytech
⁠Directory structure.

Just to recap, we create a directory on our local machine called python-docker, then inside the folder we create the docker-compose and mysql.env file as shown.


apache-docker

|____ docker-compose (file)

|____ conf (folder)
        |____ mysql.env (file)

|____ volumes (folder)

        |____ a2-php-ini (folder)
                |____ php.ini (file)

        |____ a2-sites-availables (folder)
                |____ 000-default.conf (file)

finally we execute the command:

$ docker-compose up -d

⁠Image Variants.

The images come in many flavors, each designed for a specific use case.

  • b4: Image with bootstrap 4
  • b5: Image with bootstrap 5
  • latest: Image with bootstrap 5

jhoncytech/buster-apache:TAG

⁠Example => Image with Bootstrap 5

jhoncytech/buster-apache:b5

⁠Contacts

- Mail: [email protected]
- Web: https://jhoncytech.com
---
- Mail: [email protected]
- Web: https://jhonnygo.com
Header Logo

Tag summary

Content type

Image

Digest

Size

460.2 MB

Last updated

over 4 years ago

docker pull jhoncytech/buster-apache