diff --git a/README.md b/README.md index 19ea0a63..df523e3d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Next, navigate in your terminal to the directory you cloned this, and spin up th After that completes, follow the steps from the [src/README.md](src/README.md) file to get your WordPress installation added in (or create a new blank one). +Copy env.sample to .env and setup your secrets there. + Bringing up the Docker Compose network with `site` instead of just using `up`, ensures that only our site's containers are brought up at the start, instead of all of the command containers as well. The following are built for our web server, with their exposed ports detailed: - **nginx** - `:80` diff --git a/docker-compose.yml b/docker-compose.yml index 1b7c8f59..d356c76f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: build: context: . dockerfile: nginx.dockerfile - container_name: nginx + container_name: nginx_${PROJECT_NAME} ports: - 80:80 - 443:443 @@ -22,15 +22,15 @@ services: mysql: image: mysql:5.7.29 - container_name: mysql + container_name: mysql_${PROJECT_NAME} restart: always ports: - 3306:3306 environment: - MYSQL_DATABASE: wp - MYSQL_USER: wp - MYSQL_PASSWORD: secret - MYSQL_ROOT_PASSWORD: secret + MYSQL_DATABASE: $DB_NAME + MYSQL_USER: $DB_USER + MYSQL_PASSWORD: $DB_PASSWORD + MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD SERVICE_TAGS: dev SERVICE_NAME: mysql networks: @@ -40,9 +40,10 @@ services: build: context: . dockerfile: php.dockerfile - container_name: php + container_name: php_${PROJECT_NAME} volumes: - ./wordpress:/var/www/html:delegated + - ./php/php.ini:/usr/local/etc/php/php.ini networks: - wordpress @@ -50,9 +51,9 @@ services: build: context: . dockerfile: php.dockerfile - container_name: wp + container_name: wp_${PROJECT_NAME} entrypoint: ['wp', '--allow-root'] volumes: - ./wordpress:/var/www/html:delegated networks: - - wordpress \ No newline at end of file + - wordpress diff --git a/env.sample b/env.sample new file mode 100644 index 00000000..b0dc7343 --- /dev/null +++ b/env.sample @@ -0,0 +1,5 @@ +PROJECT_NAME=project1 +DB_NAME=db_name +DB_USER=wp +DB_PASSWORD=secret +DB_ROOT_PASSWORD=secret \ No newline at end of file diff --git a/nginx/certs/README.md b/nginx/certs/README.md index ffc020a7..8463ed08 100644 --- a/nginx/certs/README.md +++ b/nginx/certs/README.md @@ -1,5 +1,12 @@ ## Add local certificates here to enable https -I personally like using [mkcert]() for this. +I personally like using [mkcert](https://github.com/FiloSottile/mkcert) for this. -Follow the installation instructions, then `cd` to this directory and use `mkcert` with the local domain name of your choosing. \ No newline at end of file +Follow the installation instructions, then `cd` to this directory and use `mkcert` with the local domain name of your choosing. + +After installation of mkcert + +``` +cd ./nginx/certs +mkcert -key-file wordpress-docker.test-key.pem -cert-file wordpress-docker.test.pem localhost *.localhost +``` \ No newline at end of file diff --git a/php/php.ini b/php/php.ini new file mode 100644 index 00000000..2ea10587 --- /dev/null +++ b/php/php.ini @@ -0,0 +1,3 @@ +upload_max_filesize = 132M +post_max_size = 64M +memory_limit = 128M \ No newline at end of file