~denisebitca/docker-chyrp-lite

4c0147af2f2cb13c140e7c4a931fb9020b2e6641 — Denise Bitca 1 year, 11 months ago e71109c
refactor,add(all): added upgrading script, git is latest release
5 files changed, 20 insertions(+), 12 deletions(-)

M Dockerfile
M README.md
M build_files/entrypoint
A build_files/upgrade
M docker-compose.yml
M Dockerfile => Dockerfile +4 -2
@@ 4,12 4,14 @@ WORKDIR /var/www/html

RUN apt update && apt install -y git

COPY ./build_files/chyrp.conf /etc/nginx/conf.d/chyrp.conf
RUN rm -rf /etc/nginx/conf.d/default.conf
COPY ./build_files/chyrp.conf /etc/nginx/conf.d/default.conf

COPY ./build_files/entrypoint /bin/entrypoint
RUN chmod +x /bin/entrypoint

COPY ./build_files/upgrade /bin/upgrade
RUN chmod +x /bin/upgrade

EXPOSE 80

ENTRYPOINT ["entrypoint"]

M README.md => README.md +4 -5
@@ 29,22 29,21 @@ sudo docker-compose up -d

## Setup

Visit ``127.0.0.1:9000/install.php``.
Visit ``http://127.0.0.1:9000/install.php``.

Select "MySQL", the hostname is ``db`` and follow your .env for everything else.

Note: Chyrp URL must be ``127.0.0.1:9000`` during setup. You can change it later to the website which will host your Chyrp Lite instance, once you are ready to put it online.
Note: Chyrp URL must be ``http://127.0.0.1:9000`` during setup. You can change it later to the website which will host your Chyrp Lite instance, once you are ready to put it online.

Once setup is done, run ``sudo docker-compose exec web rm /var/www/html/install.php``.

## Updating

For now, to update, you have to do this:
```bash
sudo docker-compose exec web git pull
sudo docker-compose exec web upgrade
```

Then, go on ``127.0.0.1:9000/upgrade.php``.
Then, go to ``http://127.0.0.1:9000/upgrade.php``.

## Contributing


M build_files/entrypoint => build_files/entrypoint +6 -2
@@ 1,5 1,9 @@
#!/bin/bash

git clone https://github.com/xenocrat/chyrp-lite .
chown -R www-data:www-data /var/www/html
if [ -z "$(ls -A /var/www/html)" ]; then
	LATEST_RELEASE=$(curl -s https://api.github.com/repos/xenocrat/chyrp-lite/releases/latest | grep target_commitish | cut -d '"' -f 4);
	git clone https://github.com/xenocrat/chyrp-lite .
	git checkout $LATEST_RELEASE
	chown -R www-data:www-data /var/www/html
fi
nginx -g 'daemon off;'

A build_files/upgrade => build_files/upgrade +6 -0
@@ 0,0 1,6 @@
#!/bin/bash

LATEST_RELEASE=$(curl -s https://api.github.com/repos/xenocrat/chyrp-lite/releases/latest | grep target_commitish | cut -d '"' -f 4);
git pull
git checkout $LATEST_RELEASE
chown -R www-data:www-data /var/www/html

M docker-compose.yml => docker-compose.yml +0 -3
@@ 9,9 9,6 @@ services:
  web:
    build: .
    restart: unless-stopped
    dns:
      - 8.8.8.8
      - 8.8.4.4
    networks:
      - default
      - backend