Image for development with a simple basic structure
1.7K
$ docker pull jhoncytech/buster-apache:b5
This image will help you start any development project with a base structure.
With this structure you get:
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!
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
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
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
The images come in many flavors, each designed for a specific use case.
jhoncytech/buster-apache:TAG
jhoncytech/buster-apache:b5
- Mail: [email protected]
- Web: https://jhoncytech.com
---
- Mail: [email protected]
- Web: https://jhonnygo.com

Content type
Image
Digest
Size
460.2 MB
Last updated
over 4 years ago
docker pull jhoncytech/buster-apache