├── .gitpod.yml
├── .htaccess
├── Dockerfile
├── README.md
├── apache
├── apache.conf
├── envvars
└── logs
│ └── .gitignore
└── mysql
├── data
└── .gitignore
├── logs
└── .gitignore
└── mysql.cnf
/.gitpod.yml:
--------------------------------------------------------------------------------
1 | image:
2 | file: Dockerfile
3 | ports:
4 | - port: 8080
5 | - port: 3306
6 | onOpen: ignore
7 | checkoutLocation: "wordpress"
8 | workspaceLocation: "."
9 | tasks:
10 | - name: MySQL
11 | init: wp core download --path=$GITPOD_REPO_ROOT;
12 | command: >
13 | mysqld --initialize-insecure;
14 | mysqld &
15 | sleep 5;
16 | cd $GITPOD_REPO_ROOT;
17 | wp config create --dbname=wpclidemo --dbuser=root;
18 | wp db create;
19 | wp core install --url=$(gp url 8080) --title="WP-Gitpod" --admin_user=gitpod --admin_password=gitpod --admin_email=admin@email.com;
20 | curl http://loripsum.net/api/3 | wp post generate --post_content --count=10;
21 | - name: Apache
22 | command: >
23 | apachectl start;
24 | - name: WordPress
25 | command: >
26 | chmod 660 $GITPOD_REPO_ROOT/.htaccess;
27 | cd $GITPOD_REPO_ROOT;
28 |
--------------------------------------------------------------------------------
/.htaccess:
--------------------------------------------------------------------------------
1 | SetEnvIf X-Forwarded-Proto https HTTPS
2 | # BEGIN WordPress
3 |
4 | RewriteEngine On
5 | RewriteBase /
6 | RewriteRule ^index\.php$ - [L]
7 | RewriteCond %{REQUEST_FILENAME} !-f
8 | RewriteCond %{REQUEST_FILENAME} !-d
9 | RewriteRule . /index.php [L]
10 |
11 | # END WordPress
12 |
13 | php_value upload_max_filesize 40M
14 | php_value post_max_size 42M
15 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM gitpod/workspace-full
2 |
3 | USER root
4 |
5 | RUN apt-get update && apt-get -y install apache2 mysql-server php-curl php-gd php-mbstring php-xml php-xmlrpc
6 |
7 | RUN echo "include /workspace/wordpress/apache/apache.conf" > /etc/apache2/apache2.conf
8 | RUN echo ". /workspace/wordpress/apache/envvars" > /etc/apache2/envvars
9 |
10 | RUN echo "!include /workspace/wordpress/mysql/mysql.cnf" > /etc/mysql/my.cnf
11 |
12 | RUN mkdir /var/run/mysqld
13 | RUN chown gitpod:gitpod /var/run/apache2 /var/lock/apache2 /var/run/mysqld
14 |
15 | RUN addgroup gitpod www-data
16 |
17 | RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
18 |
19 | RUN chmod +x wp-cli.phar
20 | RUN sudo mv wp-cli.phar /usr/local/bin/wp
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Run Wordpress on gitpod
2 |
3 | You can use this repository to run a plain WordPress installation on [Gitpod](https://gitpod.io).
4 |
5 | Using:
6 |
7 | Apache
8 |
9 | MySql
10 | - User: root
11 | - Pass: (no password)
12 |
13 | WP-CLI
14 | - Admin User: gitpod
15 | - Admin pass: gitpod
16 |
17 | ## Useful commands
18 |
19 | - Create dummy posts
20 | ```curl http://loripsum.net/api/3 | wp post generate --post_content --count=10```
21 |
22 | This project was forked from [https://github.com/meysholdt/laravel-apache-mysql-php-in-gitpod-example](https://github.com/meysholdt/laravel-apache-mysql-php-in-gitpod-example) and adapted to WordPress :)
23 |
24 | Big thanks to [meysholdt](https://github.com/meysholdt) and [alesanchezr](https://github.com/alesanchezr)
25 |
--------------------------------------------------------------------------------
/apache/apache.conf:
--------------------------------------------------------------------------------
1 | # Apache httpd v2.4 minimal configuration
2 | # see https://wiki.apache.org/httpd/Minimal_Config for documentation
3 |
4 | ServerRoot ${GITPOD_REPO_ROOT}
5 |
6 | PidFile ${APACHE_PID_FILE}
7 | User ${APACHE_RUN_USER}
8 | Group ${APACHE_RUN_GROUP}
9 |
10 | # Modules as installed/activated via apt-get
11 | IncludeOptional /etc/apache2/mods-enabled/*.load
12 | IncludeOptional /etc/apache2/mods-enabled/*.conf
13 | LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
14 |
15 | # Configure hostname and port for server
16 | ServerName ${APACHE_SERVER_NAME}
17 | Listen *:8080
18 |
19 | # Configure Logging
20 | LogFormat "%h %l %u %t \"%r\" %>s %b" common
21 | CustomLog ${APACHE_LOG_DIR}/access.log common
22 | ErrorLog ${APACHE_LOG_DIR}/error.log
23 |
24 | # Never change this block
25 |
26 | AllowOverride All
27 | Require all denied
28 |
29 |
30 | # Directory and files to be served
31 | DirectoryIndex index.html
32 | DocumentRoot "${GITPOD_REPO_ROOT}"
33 |
34 | Options Indexes FollowSymLinks
35 | AllowOverride All
36 | Require all granted
37 |
38 |
39 | # Include conf installed via apt-get
40 | IncludeOptional /etc/apache2/conf-enabled/*.conf
41 |
--------------------------------------------------------------------------------
/apache/envvars:
--------------------------------------------------------------------------------
1 | unset HOME
2 | export LANG=C
3 | export APACHE_SERVER_NAME=$(gp url 8080 | sed -e s/https:\\/\\/// | sed -e s/\\///)
4 | export APACHE_RUN_USER="gitpod"
5 | export APACHE_RUN_GROUP="gitpod"
6 | export APACHE_RUN_DIR=/var/run/apache2
7 | export APACHE_PID_FILE="$APACHE_RUN_DIR/apache.pid"
8 | export APACHE_LOCK_DIR=/var/lock/apache2
9 | export APACHE_LOG_DIR=/workspace/wordpress/apache/logs
10 |
--------------------------------------------------------------------------------
/apache/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/mysql/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/mysql/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/mysql/mysql.cnf:
--------------------------------------------------------------------------------
1 | #
2 | # see /etc/mysql/mysql.conf.d/mysqld.cnf for documentation
3 | #
4 |
5 | [mysqld_safe]
6 | socket = /var/run/mysqld/mysqld.sock
7 | nice = 0
8 |
9 | [mysqld]
10 | user = gitpod
11 | pid-file = /var/run/mysqld/mysqld.pid
12 | socket = /var/run/mysqld/mysqld.sock
13 | port = 3306
14 | basedir = /usr
15 | datadir = /workspace/wordpress/mysql/data
16 | tmpdir = /tmp
17 | lc-messages-dir = /usr/share/mysql
18 | skip-external-locking
19 | bind-address = 127.0.0.1
20 |
21 | key_buffer_size = 16M
22 | max_allowed_packet = 16M
23 | thread_stack = 192K
24 | thread_cache_size = 8
25 |
26 | myisam-recover-options = BACKUP
27 | query_cache_limit = 1M
28 | query_cache_size = 16M
29 |
30 | general_log_file = /workspace/wordpress/mysql/logs/mysql.log
31 | general_log = 1
32 | log_error = /workspace/wordpress/mysql/logs/error.log
33 |
34 | expire_logs_days = 10
35 | max_binlog_size = 100M
36 |
37 | [client]
38 | user=gitpod
39 | password=gitpod
40 |
--------------------------------------------------------------------------------