Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker files for ProcessWire

These files is a base structure for ProcessWire projects using Docker.

This is a testing environment docker configuration tailored for ProcessWire. If you want to use it in production you must properly check security and other configurations.

Setup

For starting the project use

$ docker compose up -d --build

A new Apache and MariaDB instance will start.

Configure your ProcessWire files in public directory. You can copy files from a existing project or install a fresh copy.

Dev Environment

Create a new .env file with the environment configuration. Use env.example.txt file as base.

Use these credentials in ProcessWire configuration.

WEB_PORT=8080
MARIADB_HOST=db
MARIADB_PORT=3306
MARIADB_DATABASE=pw_db
MARIADB_USER=pw_user
MARIADB_PASSWORD=pw_password
MARIADB_ROOT_PASSWORD=root_password

Access the database using an external tool such as HeidiSQL or DBeaver. Use the local machine IP and port:

  • host : 127.0.0.1
  • port 3306

Important

Always backup your database sql because you may loose your data if you prune your containers.

Known Issues

These issues may ocur if the docker container was incorrectly stopped or pruned and restarted.

All the files are stored inside docker/database.

When starting database could fail. Delete the file tc.log.

When importing sql may show Error : Tablespace for table xxxx exists. Please DISCARD the tablespace before IMPORT.. Search for *.idb files without it's matching *.frm file. Move those idb files to another directory or delete them.

PHP

For changing PHP settings go to docker/php/config/local.ini and then rebuild the containers. For installing additional modules change the docker/php/Dockerfile.

  • Default timezone UTC.

Local host

Once Docker is running you can access ProcessWire by going to localhost in your browser. 127.0.0.1:8080. Is recommended that you edit your hosts file to add a custom domain.

If you want to use another port (default is 8080) you must change it in the docker-compose.yaml file.

ports:
    # local port : docker port
    - 8080:80

Docker Commands

  • docker-compose up -d : Starts the containers
  • docker ps: Show the running containers
  • docker kill <container id>: Kills a container
  • docker network prune: Reset the network
  • docker container prune: Resets the stopped containers

Taskfile

A Taskfile is a way of simplifyng some tasks.

  • task up: Will start the containers.
  • task down: Will stop the containers.
  • task restart: Will stop and then start the containers.

Other Resources

Made with ♥ by Ninjas.cl.

About

📦 Docker files for ProcessWire

Topics

Resources

Stars

15 stars

Watchers

2 watching

Forks

Releases

Contributors

Languages