{"id":23123107,"url":"https://github.com/devgeniem/docker-wordpress","last_synced_at":"2025-08-17T03:31:19.808Z","repository":{"id":59433106,"uuid":"60768392","full_name":"devgeniem/docker-wordpress","owner":"devgeniem","description":"Minimalistic and secure php7+nginx docker container for WordPress","archived":false,"fork":false,"pushed_at":"2023-04-25T14:58:37.000Z","size":230,"stargazers_count":33,"open_issues_count":2,"forks_count":12,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-04-09T22:09:37.102Z","etag":null,"topics":["docker","nginx","php","wordpress"],"latest_commit_sha":null,"homepage":"","language":"Nginx","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devgeniem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-09T11:05:03.000Z","updated_at":"2023-06-11T17:03:07.000Z","dependencies_parsed_at":"2022-09-17T06:10:49.985Z","dependency_job_id":null,"html_url":"https://github.com/devgeniem/docker-wordpress","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgeniem%2Fdocker-wordpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgeniem%2Fdocker-wordpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgeniem%2Fdocker-wordpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgeniem%2Fdocker-wordpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devgeniem","download_url":"https://codeload.github.com/devgeniem/docker-wordpress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230080881,"owners_count":18169651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","nginx","php","wordpress"],"created_at":"2024-12-17T07:32:39.988Z","updated_at":"2024-12-17T07:32:40.857Z","avatar_url":"https://github.com/devgeniem.png","language":"Nginx","readme":"# Lightweight PHP-FPM \u0026 Nginx Docker Image for WordPress\n[![devgeniem/alpine-wordpress docker image](http://dockeri.co/image/devgeniem/wordpress-server)](https://registry.hub.docker.com/u/devgeniem/wordpress-server/)\n\n[![License](https://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)\n\nThis is maintained repository. We use this project in production and recommend this for your projects too. This container doesn't have mysql or email, you need to provide them from elsewhere. This can be other container or your host machine.\n\nI tried to include all build, test and project tools in [docker-alpine-wordpress](https://github.com/devgeniem/docker-alpine-wordpress) image. I think that more modular design is better for docker and security as well.\n\nThis project tries to be as minimal as possible and doesn't include anything that we don't absolutely need in the runtime.\n\n## Aren't you only supposed to run one process per container?\nWe think that docker container should be small set of processes which provide one service rather than one clumsy process. This container uses [s6-overlay](https://github.com/just-containers/s6-overlay) in order to run php-fpm and nginx together.\n\n## Container layout\nMount your wordpress project into:\n```\n/var/www/project\n```\n\nYour project should define web root in:\n```\n/var/www/project/web\n```\nThis is the place where nginx will serve requests. This is compatible with [bedrock layout](https://github.com/roots/bedrock).\n\n### Override project path\nYou can use `OVERRIDE_PROJECT_ROOT` variable to change project path with symlink.\n\nFor example in `Drone CI` all mounts are done into `/drone/src` folder and we use `OVERRIDE_PROJECT_ROOT=/drone/src/project` in our testing.\n\nContainer creates a symlink from /var/www/project into `$OVERRIDE_PROJECT_ROOT` which allows us to use custom path.\n\n## User permissions\nYou can use `WP_GID` and `WP_UID` env to change web user and group.\n\nIf these are not set container will look for owner:group from files mounted in `/var/www/project/web/`.\n\nIf these files are owned by root user or root group the container will automatically use 100:101 as permissions instead. This is so that we won't never run nginx and php-fpm as root.\n\n## Nginx includes\nYou can have custom nginx includes in your project mount `/var/www/project/nginx`.\n\n**Include into http {} block:**\n`/var/www/project/nginx/http/*.conf`\n\n**Include into server {} block:**\n`/var/www/project/nginx/server/*.conf`\n\nSee more in our [wp-project template](https://github.com/devgeniem/wp-project).\n\n## Cron jobs\nYou can place cron file in `/var/www/project/tasks.cron`. This is symlinked to crond and run as user `wordpress`.\n\nFor example:\n```\n# do daily/weekly/monthly maintenance\n*       *       *       *       *       echo \"test log from: $(whoami)...\" \u003e\u003e /tmp/test.log\n```\n\n## Environment Variables\n\n### Timezone\nThis sets timezone for the environment and php. See candidates here: http://php.net/manual/en/timezones.php\n```\nTZ     # Default: 'Europe/Helsinki'\n```\n\n### Development/Production\n\n```\nWP_ENV # Default: '' Options: development,testing,production,pretty-much-anything-you-want\n```\n\n### Database variables (mysql/mariadb)\n\n```\nDB_NAME     # Default: ''\nDB_PASSWORD # Default: ''\nDB_USER     # Default: ''\nDB_HOST     # Default: ''\nDB_PORT     # Default: ''\n```\n\nRemember to set `DB_NAME`, `DB_PASSWORD` and `DB_USER` and use these variables in your wp-config.php. These are automatically added as envs in php context.\n\n### Email variables\n\n```\nSMTP_HOST\n```\n\nThis variable changes the host where container tries to send mail from. By default this is docker host `172.17.0.1`.\n\n```\nSMTP_PORT\n```\n\nThis variable changes the port where container tries to connect in order to send mail. By default this is `25`.\n\n```\nSMTP_TLS\n```\n\nIf this is provided use username in authenticating to mail server. Default: null\n```\nSMTP_USER\n```\n\nIf this is provided use password in authenticating to mail server. Default: null\n```\nSMTP_PASSWORD\n```\n\nIf this is `on` mail will use username/password authentication in connections to smtp server.\nThis will automatically activate if you use `SMTP_USER` and `SMTP_PASSWORD`. Default: `off`\n```\nSMTP_AUTH\n```\n\nSee more about these variables in [msmtp docs](http://msmtp.sourceforge.net/doc/msmtp.html#Authentication).\n\n### PHP and Nginx Variables\nYou can change following env to change php configs:\n\n```\n# Variables and default values\nPHP_MEMORY_LIMIT=128M\nNGINX_MAX_BODY_SIZE=64M\nNGINX_FASTCGI_TIMEOUT=30\n```\n\n## What's inside container:\n### For running WordPress\n- php7\n- php-fpm7\n- nginx\n- wp-cli\n\n### For sending emails with smtp server\n- msmtp\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgeniem%2Fdocker-wordpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevgeniem%2Fdocker-wordpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgeniem%2Fdocker-wordpress/lists"}