Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
add Hugo specific docker-compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
jmMeessen committed Mar 13, 2017
1 parent 0aef4b7 commit 6684554
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
1 change: 0 additions & 1 deletion compose_scripts/compose.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: '2'

#test
services:

web:
Expand Down
15 changes: 15 additions & 0 deletions roles/hugo/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,18 @@
- name: set run.sh as executable
file: path={{ work_dir }}/docker/hugo-dockerfile/run.sh state=touch mode="u+rx,g+rx,o+rx"

- name: Update the dockerfile template and copy to where it belongs
template: src=docker-compose.j2
dest={{ work_dir }}/docker/hugo-compose.yml
mode="a+rx"
force=yes

- name: create a compose file list configuration file with lineinfile
lineinfile: dest={{ work_dir }}/docker/setComposeList.sh
regexp='^export COMPOSE_FILE=(.*)$'
line='export COMPOSE_FILE=\1:hugo-compose.yml'
backup=True
backrefs=True
mode="a+rx"
state=present

28 changes: 28 additions & 0 deletions roles/hugo/templates/docker-compose.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '2'

services:

web:
volumes:
- hugo_out:/usr/share/nginx/html:ro
depends_on:
- hugo

hugo:
build: ./hugo-dockerfile
volumes:
- hugo_src:/src
- hugo_out:/output
environment:
#- HUGO_WATCH=true
- HUGO_REFRESH_TIME=3600
- HUGO_THEME=casper
- HUGO_BASEURL=https://www.the-captains-shack.com
restart: unless-stopped

volumes:
hugo_src:
driver: local

hugo_out:
driver: local
2 changes: 1 addition & 1 deletion vagrant-sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
- docker
- nginx
- gogs
#- hugo
- hugo


0 comments on commit 6684554

Please sign in to comment.