forked from jeroenpardon/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan
committed
Dec 16, 2021
1 parent
804a22b
commit 67f51d0
Showing
5 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ubuntu:latest | ||
|
||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install nginx git cron nano | ||
|
||
COPY install.sh /tmp/ | ||
|
||
EXPOSE 80 | ||
|
||
# execute install, start cron and nginx | ||
CMD chmod +x /tmp/install.sh && /tmp/install.sh && cron && nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,16 @@ To run at a different port open edit docker-compose.yml: | |
ports: | ||
- 4000:80 | ||
|
||
#### Install pull from git variant: | ||
|
||
- refreshs source code every 5 minutes from master branch you provided - convenience feature for lacy devs | ||
- `git clone` this repository | ||
- build image `docker build -f DockerfilePullFromGit -t sui:latest .` | ||
- run image with `docker run -e GITURL='https://x:[email protected]/jeroenpardon/sui.git' -p 8081:80 sui:latest` | ||
- can be run also with a private repository by setting username:api-key@ in the url (see above example). Otherwise remove this part of the url. | ||
|
||
|
||
|
||
### Customization | ||
|
||
#### Changing color themes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cd /var/www/html | ||
git -C repo pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
cd /var/www/html | ||
git clone $GITURL sui | ||
mv sui/* . | ||
rm -rf sui | ||
echo "pulled update" | ||
|
||
# Copy hello-cron file to the cron.d directory | ||
cp sui-cron /etc/cron.d/sui-cron | ||
|
||
# Give execution rights on the cron job | ||
chmod 0644 /etc/cron.d/sui-cron | ||
|
||
# set pull script permissions | ||
chmod +x gitpull.sh | ||
|
||
# Apply cron job | ||
crontab /etc/cron.d/sui-cron | ||
|
||
# Create the log file to be able to run tail | ||
touch /var/log/cron.log | ||
|
||
# configure nginx | ||
echo "daemon off;" >> /etc/nginx/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*/1 * * * * /var/www/html/gitpull.sh >> /var/log/cron.log 2>&1 | ||
# An empty line is required at the end of this file for a valid cron file. |