-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
40 lines (38 loc) · 1.14 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
version: "3.7"
services:
blog:
# build: .
# docker run -it --rm -v "$PWD":/usr/src/app -p "4000:4000" starefossen/github-pages
image: starefossen/github-pages
volumes:
- ./:/usr/src/app
ports:
- 4000:4000
# command:
# - jekyll
# - serve
# - --watch
# - --host=0.0.0.0
new-post:
image: alpine
volumes:
- ./:/blog
# Requires NEW_POST variable be set to create a new post so that it doesn't come up with the other services
entrypoint:
- 'sh'
- '-c'
- |
[ "$$NEW_POST" ] || exit 1
read -p "New Blog-Post Title: " title
[ "$$title" ] || exit 1
filename=$$( echo `date +/blog/_posts/%Y-%m-%d-%s-$$(echo "$$title" | sed "s/[^a-zA-Z0-9]//g").markdown`)
echo "$$filename"
echo "---" > "$$filename"
echo "layout: post" >> "$$filename"
echo "title: \"$$title\"" >> "$$filename"
echo "categories: blog" >> "$$filename"
echo "reddit: false" >> "$$filename"
echo "---" >> "$$filename"
stdin_open: true
tty: true