From 920c0d303f9bce6207e221726bbacaa2022b540a Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 1 Jul 2018 20:36:09 +0000 Subject: [PATCH] fix build --- Dockerfile | 7 ++++--- cmd/site/main.go | 14 ++++---------- .../favicon/android-icon-144x144.png | Bin .../favicon/android-icon-192x192.png | Bin .../favicon/android-icon-36x36.png | Bin .../favicon/android-icon-48x48.png | Bin .../favicon/android-icon-72x72.png | Bin .../favicon/android-icon-96x96.png | Bin .../favicon/apple-icon-114x114.png | Bin .../favicon/apple-icon-120x120.png | Bin .../favicon/apple-icon-144x144.png | Bin .../favicon/apple-icon-152x152.png | Bin .../favicon/apple-icon-180x180.png | Bin {static => static2}/favicon/apple-icon-57x57.png | Bin {static => static2}/favicon/apple-icon-60x60.png | Bin {static => static2}/favicon/apple-icon-72x72.png | Bin {static => static2}/favicon/apple-icon-76x76.png | Bin .../favicon/apple-icon-precomposed.png | Bin {static => static2}/favicon/apple-icon.png | Bin {static => static2}/favicon/browserconfig.xml | 0 {static => static2}/favicon/favicon-16x16.png | Bin {static => static2}/favicon/favicon-32x32.png | Bin {static => static2}/favicon/favicon-96x96.png | Bin {static => static2}/favicon/favicon.ico | Bin {static => static2}/favicon/manifest.json | 0 {static => static2}/favicon/ms-icon-144x144.png | Bin {static => static2}/favicon/ms-icon-150x150.png | Bin {static => static2}/favicon/ms-icon-310x310.png | Bin {static => static2}/favicon/ms-icon-70x70.png | Bin {static => static2}/geekcode.txt | 0 {static => static2}/gpg.pub | 0 {static => static2}/img/about/tower.jpg | Bin {static => static2}/img/avatar.png | Bin {static => static2}/img/lokahi.dot | 0 {static => static2}/img/lokahi.png | Bin {static => static2}/keybase.txt | 0 {static => static2}/resume/resume.md | 0 37 files changed, 8 insertions(+), 13 deletions(-) rename {static => static2}/favicon/android-icon-144x144.png (100%) rename {static => static2}/favicon/android-icon-192x192.png (100%) rename {static => static2}/favicon/android-icon-36x36.png (100%) rename {static => static2}/favicon/android-icon-48x48.png (100%) rename {static => static2}/favicon/android-icon-72x72.png (100%) rename {static => static2}/favicon/android-icon-96x96.png (100%) rename {static => static2}/favicon/apple-icon-114x114.png (100%) rename {static => static2}/favicon/apple-icon-120x120.png (100%) rename {static => static2}/favicon/apple-icon-144x144.png (100%) rename {static => static2}/favicon/apple-icon-152x152.png (100%) rename {static => static2}/favicon/apple-icon-180x180.png (100%) rename {static => static2}/favicon/apple-icon-57x57.png (100%) rename {static => static2}/favicon/apple-icon-60x60.png (100%) rename {static => static2}/favicon/apple-icon-72x72.png (100%) rename {static => static2}/favicon/apple-icon-76x76.png (100%) rename {static => static2}/favicon/apple-icon-precomposed.png (100%) rename {static => static2}/favicon/apple-icon.png (100%) rename {static => static2}/favicon/browserconfig.xml (100%) rename {static => static2}/favicon/favicon-16x16.png (100%) rename {static => static2}/favicon/favicon-32x32.png (100%) rename {static => static2}/favicon/favicon-96x96.png (100%) rename {static => static2}/favicon/favicon.ico (100%) rename {static => static2}/favicon/manifest.json (100%) rename {static => static2}/favicon/ms-icon-144x144.png (100%) rename {static => static2}/favicon/ms-icon-150x150.png (100%) rename {static => static2}/favicon/ms-icon-310x310.png (100%) rename {static => static2}/favicon/ms-icon-70x70.png (100%) rename {static => static2}/geekcode.txt (100%) rename {static => static2}/gpg.pub (100%) rename {static => static2}/img/about/tower.jpg (100%) rename {static => static2}/img/avatar.png (100%) rename {static => static2}/img/lokahi.dot (100%) rename {static => static2}/img/lokahi.png (100%) rename {static => static2}/keybase.txt (100%) rename {static => static2}/resume/resume.md (100%) diff --git a/Dockerfile b/Dockerfile index 1cacffa..93e7a6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,16 @@ FROM xena/go:1.10 AS build COPY . /root/go/src/github.com/Xe/site -RUN GOBIN=/root go build github.com/Xe/site +RUN CGO_ENABLED=0 GOBIN=/root go install github.com/Xe/site/cmd/site FROM xena/alpine EXPOSE 5000 RUN apk add --no-cache bash COPY --from=build /root/site /site/site +COPY ./static2 /site/static COPY ./templates /site/templates COPY ./blog /site/blog -COPY ./run.sh /site.sh -COPY ./static /site/static +COPY ./css /site/css +COPY ./run.sh /site/run.sh HEALTHCHECK CMD curl --fail http://127.0.0.1:5000 || exit 1 CMD /site/run.sh diff --git a/cmd/site/main.go b/cmd/site/main.go index e0cc20d..bad297e 100644 --- a/cmd/site/main.go +++ b/cmd/site/main.go @@ -12,7 +12,6 @@ import ( "sync" "time" - "github.com/GeertJohan/go.rice" "github.com/Xe/jsonfeed" "github.com/Xe/ln" "github.com/gorilla/feeds" @@ -135,17 +134,12 @@ func Build() (*Site, error) { sort.Sort(sort.Reverse(s.Posts)) - cb, err := rice.FindBox("css") + resumeData, err := ioutil.ReadFile("./static/resume/resume.md") if err != nil { return nil, err } - sb, err := rice.FindBox("static") - if err != nil { - return nil, err - } - - s.Resume = template.HTML(blackfriday.Run(sb.MustBytes("resume/resume.md"))) + s.Resume = template.HTML(blackfriday.Run(resumeData)) for _, item := range s.Posts { itime, _ := time.Parse("2006-01-02", item.Date) @@ -174,8 +168,8 @@ func Build() (*Site, error) { s.mux.HandleFunc("/blog.atom", s.createAtom) s.mux.HandleFunc("/blog.json", s.createJsonFeed) s.mux.HandleFunc("/blog/", s.showPost) - s.mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(sb.HTTPBox()))) - s.mux.Handle("/css/", http.StripPrefix("/css/", http.FileServer(cb.HTTPBox()))) + s.mux.Handle("/css/", http.FileServer(http.Dir("."))) + s.mux.Handle("/static/", http.FileServer(http.Dir("."))) return s, nil } diff --git a/static/favicon/android-icon-144x144.png b/static2/favicon/android-icon-144x144.png similarity index 100% rename from static/favicon/android-icon-144x144.png rename to static2/favicon/android-icon-144x144.png diff --git a/static/favicon/android-icon-192x192.png b/static2/favicon/android-icon-192x192.png similarity index 100% rename from static/favicon/android-icon-192x192.png rename to static2/favicon/android-icon-192x192.png diff --git a/static/favicon/android-icon-36x36.png b/static2/favicon/android-icon-36x36.png similarity index 100% rename from static/favicon/android-icon-36x36.png rename to static2/favicon/android-icon-36x36.png diff --git a/static/favicon/android-icon-48x48.png b/static2/favicon/android-icon-48x48.png similarity index 100% rename from static/favicon/android-icon-48x48.png rename to static2/favicon/android-icon-48x48.png diff --git a/static/favicon/android-icon-72x72.png b/static2/favicon/android-icon-72x72.png similarity index 100% rename from static/favicon/android-icon-72x72.png rename to static2/favicon/android-icon-72x72.png diff --git a/static/favicon/android-icon-96x96.png b/static2/favicon/android-icon-96x96.png similarity index 100% rename from static/favicon/android-icon-96x96.png rename to static2/favicon/android-icon-96x96.png diff --git a/static/favicon/apple-icon-114x114.png b/static2/favicon/apple-icon-114x114.png similarity index 100% rename from static/favicon/apple-icon-114x114.png rename to static2/favicon/apple-icon-114x114.png diff --git a/static/favicon/apple-icon-120x120.png b/static2/favicon/apple-icon-120x120.png similarity index 100% rename from static/favicon/apple-icon-120x120.png rename to static2/favicon/apple-icon-120x120.png diff --git a/static/favicon/apple-icon-144x144.png b/static2/favicon/apple-icon-144x144.png similarity index 100% rename from static/favicon/apple-icon-144x144.png rename to static2/favicon/apple-icon-144x144.png diff --git a/static/favicon/apple-icon-152x152.png b/static2/favicon/apple-icon-152x152.png similarity index 100% rename from static/favicon/apple-icon-152x152.png rename to static2/favicon/apple-icon-152x152.png diff --git a/static/favicon/apple-icon-180x180.png b/static2/favicon/apple-icon-180x180.png similarity index 100% rename from static/favicon/apple-icon-180x180.png rename to static2/favicon/apple-icon-180x180.png diff --git a/static/favicon/apple-icon-57x57.png b/static2/favicon/apple-icon-57x57.png similarity index 100% rename from static/favicon/apple-icon-57x57.png rename to static2/favicon/apple-icon-57x57.png diff --git a/static/favicon/apple-icon-60x60.png b/static2/favicon/apple-icon-60x60.png similarity index 100% rename from static/favicon/apple-icon-60x60.png rename to static2/favicon/apple-icon-60x60.png diff --git a/static/favicon/apple-icon-72x72.png b/static2/favicon/apple-icon-72x72.png similarity index 100% rename from static/favicon/apple-icon-72x72.png rename to static2/favicon/apple-icon-72x72.png diff --git a/static/favicon/apple-icon-76x76.png b/static2/favicon/apple-icon-76x76.png similarity index 100% rename from static/favicon/apple-icon-76x76.png rename to static2/favicon/apple-icon-76x76.png diff --git a/static/favicon/apple-icon-precomposed.png b/static2/favicon/apple-icon-precomposed.png similarity index 100% rename from static/favicon/apple-icon-precomposed.png rename to static2/favicon/apple-icon-precomposed.png diff --git a/static/favicon/apple-icon.png b/static2/favicon/apple-icon.png similarity index 100% rename from static/favicon/apple-icon.png rename to static2/favicon/apple-icon.png diff --git a/static/favicon/browserconfig.xml b/static2/favicon/browserconfig.xml similarity index 100% rename from static/favicon/browserconfig.xml rename to static2/favicon/browserconfig.xml diff --git a/static/favicon/favicon-16x16.png b/static2/favicon/favicon-16x16.png similarity index 100% rename from static/favicon/favicon-16x16.png rename to static2/favicon/favicon-16x16.png diff --git a/static/favicon/favicon-32x32.png b/static2/favicon/favicon-32x32.png similarity index 100% rename from static/favicon/favicon-32x32.png rename to static2/favicon/favicon-32x32.png diff --git a/static/favicon/favicon-96x96.png b/static2/favicon/favicon-96x96.png similarity index 100% rename from static/favicon/favicon-96x96.png rename to static2/favicon/favicon-96x96.png diff --git a/static/favicon/favicon.ico b/static2/favicon/favicon.ico similarity index 100% rename from static/favicon/favicon.ico rename to static2/favicon/favicon.ico diff --git a/static/favicon/manifest.json b/static2/favicon/manifest.json similarity index 100% rename from static/favicon/manifest.json rename to static2/favicon/manifest.json diff --git a/static/favicon/ms-icon-144x144.png b/static2/favicon/ms-icon-144x144.png similarity index 100% rename from static/favicon/ms-icon-144x144.png rename to static2/favicon/ms-icon-144x144.png diff --git a/static/favicon/ms-icon-150x150.png b/static2/favicon/ms-icon-150x150.png similarity index 100% rename from static/favicon/ms-icon-150x150.png rename to static2/favicon/ms-icon-150x150.png diff --git a/static/favicon/ms-icon-310x310.png b/static2/favicon/ms-icon-310x310.png similarity index 100% rename from static/favicon/ms-icon-310x310.png rename to static2/favicon/ms-icon-310x310.png diff --git a/static/favicon/ms-icon-70x70.png b/static2/favicon/ms-icon-70x70.png similarity index 100% rename from static/favicon/ms-icon-70x70.png rename to static2/favicon/ms-icon-70x70.png diff --git a/static/geekcode.txt b/static2/geekcode.txt similarity index 100% rename from static/geekcode.txt rename to static2/geekcode.txt diff --git a/static/gpg.pub b/static2/gpg.pub similarity index 100% rename from static/gpg.pub rename to static2/gpg.pub diff --git a/static/img/about/tower.jpg b/static2/img/about/tower.jpg similarity index 100% rename from static/img/about/tower.jpg rename to static2/img/about/tower.jpg diff --git a/static/img/avatar.png b/static2/img/avatar.png similarity index 100% rename from static/img/avatar.png rename to static2/img/avatar.png diff --git a/static/img/lokahi.dot b/static2/img/lokahi.dot similarity index 100% rename from static/img/lokahi.dot rename to static2/img/lokahi.dot diff --git a/static/img/lokahi.png b/static2/img/lokahi.png similarity index 100% rename from static/img/lokahi.png rename to static2/img/lokahi.png diff --git a/static/keybase.txt b/static2/keybase.txt similarity index 100% rename from static/keybase.txt rename to static2/keybase.txt diff --git a/static/resume/resume.md b/static2/resume/resume.md similarity index 100% rename from static/resume/resume.md rename to static2/resume/resume.md