You need Docker, php-cli and node installed on your system.
On Windows we recommend Bash on Ubuntu on Windows.
Now follow the upcoming instructions.
# Clone the project:
$ git clone [email protected]:serlo-org/athene2.git
$ cd athene2
If you are on windows, run the following in Bash on Windows:
# Copy some config files
$ cp docker-compose.dist.yml docker-compose.yml
$ cp src/config/autoload/local.dist.php src/config/autoload/local.php
$ cp src/config/autoload/develop.local.dist.php src/config/autoload/develop.local.php
$ cp src/public/htaccess.dist src/public/.htaccess
# Install various dependencies
$ php composer.phar install
docker-compose up --build -d
If php composer.phar install
fails with error
Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/collections v1.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- doctrine/collections v1.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- Installation request for doctrine/collections v1.4.0 -> satisfiable by doctrine/collections[v1.4.0].
then you can try updating php to 5.6:
sudo apt-get remove php5-cli
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6-cli
Try a different node version (i.e. using nvm). Try using node version 0.12.5
Also try cleaning the cache and rebuilding:
make sure to cd
to the correct location first!
npm cache clean -f
npm rebuild
If you get an error like bower ESUDO Cannot be run with sudo
then try running
npm run bower -- --allow-root
npm run build
# Start the docker-compose cluster.
# ps: The database import might take some time (1-10 minutes).
# If you are on Windows, run this in regular cmd.exe
$ docker-compose up --build
On windows, please add
127.0.0.1 de.serlo.localhost
127.0.0.1 en.serlo.localhost
to your C:\Windows\System32\drivers\etc\hosts.txt
file. Then run ipconfig /flushdns
in cmd.exe and
restart your browser.
On OSX:
sudo nano /etc/hosts
# add lines
127.0.0.1 de.serlo.localhost
127.0.0.1 en.serlo.localhost
# flush mac DNS cache
sudo killall -HUP mDNSResponder
Now, open de.serlo.localhost:4567. Happy coding!
ps: de.serlo.localhost:4567
works for me in chrome but not in FireFox. Not sure why, but if it doesn't work try
a different browser.
Development is straight forward, make your changes to the php files and then reload the browser. Done!
If you want to modify the assets (e.g. .css
, .js
files), you will also have to clone and set up https://github.com/serlo-org/athene2-assets:
git clone https://github.com/serlo-org/athene2-assets
cd athene2-assets
yarn
yarn start
Furthermore, set assets_host
to the url of webpack dev server in src/config/autoload/develop.local.php
:
return [
// ...
'assets_host' => 'http://localhost:8081/'
];
Changes to the assets will automatically reload the browser.
Most of these are outdated: