diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..4903764 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,23 @@ +FROM gitpod/workspace-mysql + +USER gitpod + +# Install php-dev +RUN sudo apt-get update -q \ + && sudo apt-get install -y php-dev + +# Build and install Xdebug +RUN wget http://xdebug.org/files/xdebug-2.9.1.tgz \ + && tar -xvzf xdebug-2.9.1.tgz \ + && cd xdebug-2.9.1 \ + && phpize \ + && ./configure \ + && make \ + && sudo mkdir -p /usr/lib/php/20190902 \ + && sudo cp modules/xdebug.so /usr/lib/php/20190902 \ + && sudo bash -c "echo -e '\nzend_extension = /usr/lib/php/20190902/xdebug.so\n[XDebug]\nxdebug.remote_enable = 1\nxdebug.remote_autostart = 1\n' >> /etc/php/7.4/cli/php.ini" + +# Export environment variables +ENV DATABASE_USER=root +ENV DATABASE_HOST=127.0.0.1 +ENV DATABASE_PASSWORD= diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..9bbf6f6 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +image: + file: .gitpod.Dockerfile + +# List the start up tasks. You can start them in parallel in multiple terminals. See https://www.gitpod.io/docs/config-start-tasks/ +tasks: + - init: ./setup.sh + - before: wget https://get.symfony.com/cli/installer -O - | bash + command: export PATH="$HOME/.symfony/bin:$PATH" && symfony server:start diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..221c75e --- /dev/null +++ b/setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Install databases +mysql -e 'CREATE DATABASE app;' +mysql -e 'CREATE DATABASE app_test;' + +# Install Composer dependencies +composer install