From fd4e50fcc1e72eee80d8af07209d669b25f5c20d Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 16 Mar 2022 15:18:53 +0100 Subject: Initial commit --- .env.example | 9 ++++++++ .gitignore | 4 ++++ Dockerfile | 3 +++ docker-compose.yml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ docker-wp.example.ini | 5 +++++ wpcli | 1 + 6 files changed, 83 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 docker-wp.example.ini create mode 100755 wpcli diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..51d8f52 --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +DOMAIN_1=example.org +DOMAIN_2=example.de +TRAEFIK_NETWORK=traefik-public +MYSQL_ROOT_PASSWORD=123456 +MYSQL_PASSWORD=123456 +MYSQL_DATABASE=wordpress +MYSQL_USER=wordpress +BASICAUTH_USER=admin +BASICAUTH_PASSWORD= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e745936 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.env +/db +/data +docker-wp.ini diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2a0c8e4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM wordpress:latest + +COPY docker-wp.ini "$PHP_INI_DIR/conf.d/" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c237c8a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,61 @@ +version: '3' + +services: + db: + image: mysql:5.7 + restart: always + volumes: + - "./db:/var/lib/mysql" + environment: + - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}" + - "MYSQL_PASSWORD=${MYSQL_PASSWORD}" + - "MYSQL_DATABASE=${MYSQL_DATABASE}" + - "MYSQL_USER=${MYSQL_USER}" + networks: + - internal + + app: + build: . + restart: always + depends_on: + - db + volumes: + - "./data:/var/www/html" + environment: + - "WORDPRESS_DB_HOST=db" + - "WORDPRESS_DB_USER=${MYSQL_USER}" + - "WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}" + - "WORDPRESS_DB_NAME=${MYSQL_DATABASE}" + #- "WORDPRESS_DEBUG=1" + networks: + - internal + - traefik-public + labels: + - "traefik.enable=true" + - "traefik.docker.network=${TRAEFIK_NETWORK}" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-app.rule=Host(`${DOMAIN_1}`) || Host(`${DOMAIN_2}`)" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-app.entrypoints=websecure" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-app.tls.certresolver=letsencrypt" + #- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-app.middlewares=${COMPOSE_PROJECT_NAME}-basicauth" + #- "traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-basicauth.basicauth.users=${BASISAUTH_USER}:${BASICAUTH_PASSWORD}" + + wpcli: + image: wordpress:cli + links: + - db + volumes: + - "./data:/var/www/html" + environment: + - "WORDPRESS_DB_HOST=db" + - "WORDPRESS_DB_USER=${MYSQL_USER}" + - "WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}" + networks: + - internal + working_dir: "/var/www/html" + entrypoint: wp + command: "--info" + +networks: + internal: + traefik-public: + external: true diff --git a/docker-wp.example.ini b/docker-wp.example.ini new file mode 100644 index 0000000..a236954 --- /dev/null +++ b/docker-wp.example.ini @@ -0,0 +1,5 @@ +upload_max_filesize = 512M +post_max_size = 512M + +max_execution_time = 300 +max_input_vars = 5000 diff --git a/wpcli b/wpcli new file mode 100755 index 0000000..4f332ec --- /dev/null +++ b/wpcli @@ -0,0 +1 @@ +docker-compose run --rm wpcli $@ -- cgit v1.2.3