fix build
|
@ -1,15 +1,16 @@
|
||||||
FROM xena/go:1.10 AS build
|
FROM xena/go:1.10 AS build
|
||||||
COPY . /root/go/src/github.com/Xe/site
|
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
|
FROM xena/alpine
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
RUN apk add --no-cache bash
|
RUN apk add --no-cache bash
|
||||||
COPY --from=build /root/site /site/site
|
COPY --from=build /root/site /site/site
|
||||||
|
COPY ./static2 /site/static
|
||||||
COPY ./templates /site/templates
|
COPY ./templates /site/templates
|
||||||
COPY ./blog /site/blog
|
COPY ./blog /site/blog
|
||||||
COPY ./run.sh /site.sh
|
COPY ./css /site/css
|
||||||
COPY ./static /site/static
|
COPY ./run.sh /site/run.sh
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail http://127.0.0.1:5000 || exit 1
|
HEALTHCHECK CMD curl --fail http://127.0.0.1:5000 || exit 1
|
||||||
CMD /site/run.sh
|
CMD /site/run.sh
|
||||||
|
|
|
@ -12,7 +12,6 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/GeertJohan/go.rice"
|
|
||||||
"github.com/Xe/jsonfeed"
|
"github.com/Xe/jsonfeed"
|
||||||
"github.com/Xe/ln"
|
"github.com/Xe/ln"
|
||||||
"github.com/gorilla/feeds"
|
"github.com/gorilla/feeds"
|
||||||
|
@ -135,17 +134,12 @@ func Build() (*Site, error) {
|
||||||
|
|
||||||
sort.Sort(sort.Reverse(s.Posts))
|
sort.Sort(sort.Reverse(s.Posts))
|
||||||
|
|
||||||
cb, err := rice.FindBox("css")
|
resumeData, err := ioutil.ReadFile("./static/resume/resume.md")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
sb, err := rice.FindBox("static")
|
s.Resume = template.HTML(blackfriday.Run(resumeData))
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
s.Resume = template.HTML(blackfriday.Run(sb.MustBytes("resume/resume.md")))
|
|
||||||
|
|
||||||
for _, item := range s.Posts {
|
for _, item := range s.Posts {
|
||||||
itime, _ := time.Parse("2006-01-02", item.Date)
|
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.atom", s.createAtom)
|
||||||
s.mux.HandleFunc("/blog.json", s.createJsonFeed)
|
s.mux.HandleFunc("/blog.json", s.createJsonFeed)
|
||||||
s.mux.HandleFunc("/blog/", s.showPost)
|
s.mux.HandleFunc("/blog/", s.showPost)
|
||||||
s.mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(sb.HTTPBox())))
|
s.mux.Handle("/css/", http.FileServer(http.Dir(".")))
|
||||||
s.mux.Handle("/css/", http.StripPrefix("/css/", http.FileServer(cb.HTTPBox())))
|
s.mux.Handle("/static/", http.FileServer(http.Dir(".")))
|
||||||
|
|
||||||
return s, nil
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |