The empty structure contains necessary folder and files to start building site based on project opendocks/docks.
- Clone opendocks/template i.e. this repository using command
git clone [email protected]:opendocks/template.git
OR
git clone https://github.com/opendocks/template.git
- Clone opendocks/docks repository within root of this repo using command
git clone [email protected]:opendocks/docks.git
OR
git clone https://github.com/opendocks/docks.git
- Create code and data directories in root if not already exists
- Copy your code in code folder within the root directory or any sub directory
- APP_BASE_DIR (See comments in file)
- Search {{PROJECT-IDENTIFIER}} & {{TLD}} and replace with names you preffer,
NOTE It is suggested to use
ts
to replace{{TLD}}
for local development - PHP_VERSION (Use any value from 8.1, 8.0,7.3, 7.2, 7.1, 7.0, 5.6)
- DOCKER_HOST_IP (IP of host machine)
(optional)
- PHP_IDE_CONFIG
(optional)
- Clone this
opendocks/proxy
repository using command
git clone [email protected]:opendocks/proxy.git
OR
git clone https://github.com/opendocks/proxy.git
- Create docker network using command
docker network create net1-nginx-proxy
- Run service
docker-compose up
- Above will setup nginx reverse proxy server, using IP 127.0.0.1 & default ports 80, 443
- APACHE_VIRTUAL_HOST defined in .env file contains comma separated list of domains a& sub-domains, and is used by reverse proxy server service
- Reverse proxy service will read this value will setup reverse proxy for provided host names
- Update (Windows,linux,macOS) host file to add hostname entries used in APACHE_VIRTUAL_HOST pointing reverse proxy servic (server)
- Reverse proxy will automatically, sends all requests to desired container
- Enable or disable required PHP extentions for PHP service
- Enable or disable required PHP extentions for Workspace service
- MYSQL_VERSION
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
- Check comment in file
conf/sites/appache/apache.conf
Docker compose useful commands
To build/start all services
docker-compose up
To build/start first time
docker-compose up apache php-fpm mysql
To build/rebuild explicitly
docker-compose up --build apache
Close all running Containers
docker-compose stop
To stop single container do:
docker-compose stop {container-name}
To stop and remove all containers:
docker-compose down
To stop and remove single containers:
docker-compose down {container-name}
To enter container terminal window
docker exec -it {container-name} bash
To Update all NPM packages in package.jon, (if npm-check-update is installed)
ncu -u