bach ab64d45554 working | 3 år sedan | |
---|---|---|
Docker | 3 år sedan | |
public_html @ b6730fa8d2 | 3 år sedan | |
ressources | 3 år sedan | |
.env | 3 år sedan | |
.gitignore | 3 år sedan | |
.gitmodules | 3 år sedan | |
LICENSE | 3 år sedan | |
README.md | 3 år sedan | |
docker-compose.yml | 3 år sedan |
le campus powered by grav in docker environement (nginx, php:7.0-fpm)
sudo pacman -S docker docker-compose docker-machine
this will clone this repos (main docker environement) and the grav source code
git clone --recursive -o figli https://figureslibres.io/gogs/bachir/docker-lecampus.git
add to your /etc/hosts :
127.0.0.1 dev.le campus.net
configure your vhosts to add a reverse proxy that will redirect the domain dev.figureslibres.com to our container
edit /etc/nginx/sites-available/dev.lecampus.net.conf
with :
server {
listen 80;
server_name dev.lecampus.net;
location / {
proxy_pass http://127.0.0.1:8882;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
}
then activate the vhost
sudo ln -s /etc/nginx/sites-available/dev.lecampus.net.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx
<Virtualhost *:80>
ServerName dev.lecampus.net
ProxyPass / http://127.0.0.1:8882/
ProxyPassReverse / http://127.0.0.1:8882/
ProxyRequests Off
</Virtualhost>
launch the docker daemon
sudo systemctl start docker
only before the first run (may take some time)
sudo docker-compose build --no-cache
then each time you want to launch the app
sudo docker-compose up -d
sudo docker-compose ps
sudo docker-compose logs -f
# log into the php container
sudo docker exec -it lecampus_php_1 bash
# install grav using cli
bin/grav install
# log into the php container
sudo docker exec -it lecampus_php_1 bash
# run the script
./fixperms.sh
fill the /user/pages with your contents or you'll get a 404 error
You can now visit http://dev.lecampus.net or simply http://localhost:8882 on your browser
git pull figli master
# then update all submodules
git submodule update --recursive --checkout