Ver código fonte

Use gulp to run docker.

For reasons.
master
Chris Smith 7 anos atrás
pai
commit
21499552fa
5 arquivos alterados com 50 adições e 21 exclusões
  1. 33
    1
      Dockerfile
  2. 1
    10
      docker-compose.dev.yml
  3. 1
    10
      docker-compose.yml
  4. 8
    0
      site/gulpfile.js
  5. 7
    0
      site/package.json

+ 33
- 1
Dockerfile Ver arquivo

@@ -1 +1,33 @@
1
-FROM publysher/hugo 
1
+FROM debian:jessie
2
+MAINTAINER dkr@chameth.com
3
+
4
+RUN apt-get -qq update \
5
+	&& DEBIAN_FRONTEND=noninteractive apt-get -qq install -y curl --no-install-recommends ca-certificates apt-transport-https nginx
6
+
7
+RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
8
+RUN echo 'deb https://deb.nodesource.com/node_6.x jessie main' > /etc/apt/sources.list.d/nodesource.list
9
+
10
+# Install pygments (for syntax highlighting)
11
+RUN apt-get -qq update \
12
+	&& DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends python-pygments git asciidoc nodejs \
13
+	&& rm -rf /var/lib/apt/lists/*
14
+
15
+# Download and install hugo
16
+ENV HUGO_VERSION 0.20.7
17
+ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb
18
+ADD https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} /tmp/hugo.deb
19
+RUN dpkg -i /tmp/hugo.deb \
20
+	&& rm /tmp/hugo.deb
21
+
22
+# Create working directory
23
+RUN rm -rf /var/www && mkdir /var/www
24
+WORKDIR /var/www/
25
+ADD site/ /var/www
26
+
27
+RUN npm install --global gulp-cli && npm install
28
+
29
+RUN gulp
30
+
31
+EXPOSE 80
32
+STOPSIGNAL SIGQUIT
33
+CMD ["nginx", "-g", "daemon off;"]

+ 1
- 10
docker-compose.dev.yml Ver arquivo

@@ -9,13 +9,4 @@ services:
9 9
     restart: always
10 10
     labels:
11 11
       com.chameth.vhost: 'dev.chameth.com'
12
-      com.chameth.proxy: '1313'
13
-    command:
14
-      - hugo
15
-      - server
16
-      - --bind=0.0.0.0
17
-      - --port=1313
18
-      - --baseURL=https://dev.chameth.com/
19
-      - --appendPort=false
20
-      - --disableLiveReload
21
-      - --log
12
+      com.chameth.proxy: '80'

+ 1
- 10
docker-compose.yml Ver arquivo

@@ -9,13 +9,4 @@ services:
9 9
     restart: always
10 10
     labels:
11 11
       com.chameth.vhost: 'chameth.com,www.chameth.com'
12
-      com.chameth.proxy: '1313'
13
-    command:
14
-      - hugo
15
-      - server
16
-      - --bind=0.0.0.0
17
-      - --port=1313
18
-      - --baseURL=https://www.chameth.com/
19
-      - --appendPort=false
20
-      - --disableLiveReload
21
-      - --log
12
+      com.chameth.proxy: '80'

+ 8
- 0
site/gulpfile.js Ver arquivo

@@ -0,0 +1,8 @@
1
+var gulp = require('gulp');
2
+var plugins = require('gulp-load-plugins')();
3
+
4
+gulp.task('hugo:prod', function(callback) {
5
+    gulp.src('').pipe(plugins.shell(['hugo -v -b https://www.chameth.com/ -d /var/www/html/'], { cwd: process.cwd() })).on('end', callback || function() {});;
6
+});
7
+
8
+gulp.task('default', ['hugo:prod']);

+ 7
- 0
site/package.json Ver arquivo

@@ -0,0 +1,7 @@
1
+{
2
+  "dependencies": {
3
+    "gulp": "^3.9.1",
4
+    "gulp-load-plugins": "^1.2.0",
5
+    "gulp-shell": "^0.5.0"
6
+  }
7
+}

Carregando…
Cancelar
Salvar