Skip to content

rru-hgb/fhooe-laravel-dock

Repository files navigation

fhooe-web-dock – A Docker Environment for Web Development Classes

This repository provides a Docker environment for web development designed for use in web development classes at the Upper Austria University of Applied Sciences (FH Oberösterreich), Hagenberg Campus.

This collection of Dockerfiles is based on the official Docker images for PHP 8.1, MariaDB 10.7 and phpMyAdmin 5.2.0, as well as additional configuration and scripts.

Not familiar with Docker containers or not sure why to use them? Have a look at the Introduction first.

Installation of Software and Prerequisites

To use this environment, you will need a few tools installed. Some, like Docker Desktop, are mandatory, and others are recommended.

Docker Desktop

Docker Desktop creates and runs the fhooe-web-dock containers. Download and install it for Windows, Mac OS (M1 or Intel) or Linux.

To avoid rate limit issues when downloading the underlying images from Docker Hub, please register for a free account and make sure you're logged in on Docker Desktop with it.

Git

Installing Git on your host machine is also recommended so you can easily update to the latest version of fhooe-web-dock.

  • Windows: Installer Download | Chocolatey: choco install git | Winget: winget install -e --id Git.Git

  • Mac OS X: Xcode Commandline Tools: xcode-select –install | Homebrew: brew install git

  • Linux: Debian/Ubuntu: apt-get install git

Running the Containers

Use a command prompt such as Windows Powershell or Terminal to enter the Docker commands. All commands must be entered in your local fhooe-web-dock directory.

Building and Starting the Containers

docker compose up -d

This will create three containers:

  • webapp: Apache web server with PHP functionality.
  • mariadb: MariaDB database.
  • pma: phpMyAdmin for database management.

Stopping the Containers

docker compose stop

Restarting the Containers Without Rebuilding

docker compose start

Rebuilding the Containers

Should your containers malfunction or you want to rebuild them from the latest official images (due to new versions), you can use the provided CleanInstall script.

  • Windows: Double-click CleanInstall.bat or run the command in a Powershell/command prompt.
  • Mac OS X/Linux: Run ./CleanInstall.sh from a terminal/shell. If the file is not executable, run chmod +x CleanInstall.sh first.

Warning: this script assumes that you're only using fhooe-web-dock on your system. It will affect other Docker environments as well!

  1. Stop all running fhooe-web-dock-containers (docker compose down -v).
  2. Remove all unused images, containers, networks and volumes (docker system prune --volumes -a -f). This will also affect other Docker environments on your system!
  3. Update fhooe-web-dock from GitHub (git pull).
  4. Create and start the containers again (docker compose up -d).

Working With the Containers

Once all containers have been started, you'll notice a subdirectory called webapp in your fhooe-web-dock directory. This directory is mapped to /var/www/html in the webapp container. Since this is Apache's document root, all files and projects you put in there will be directly available on the web server.

You can access the web server via HTTP or HTTPS. Be advised the HTTPS certificate is self-signed and will trigger a warning in your browser.

To access the database, you must differentiate between access from your host system (external) or one of the other containers (internal).

  • External (e.g., connecting to the database from your IDE while developing): Host: localhost, port: 6033
  • Internal (e.g., connecting to the database from your web application): Host: db, port: 3306

For shell access to your containers (in this case, the webapp container), use the following command:

docker exec -it webapp /bin/bash

To access the other containers, replace the container name webapp with mariadb (database) or pma (phpMyAdmin).

Additional Information

For more details on how to install and work with fhooe-web-dock, see INSTALL.md.

Are you having trouble with fhooe-web-dock? Check the wiki for known solutions or open an issue.

Other fhooe Docker Environments

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •