writefreely/Dockerfile
Rob Loranger 2ec67fc26a
refactor Dockerfile to work with current version
this changes the Dockerfile a bit to work with the current version
0.10.0 of writefreely, and removes the docker-setup script for now.

Kind of a work in progress but wanted to share with those interested.
2019-09-14 14:49:55 -07:00

25 lines
No EOL
703 B
Docker

FROM golang:1.12-alpine AS build
RUN apk add nodejs nodejs-npm make g++ ca-certificates git sqlite-dev && \
npm install -g less less-plugin-clean-css && \
go get -u github.com/jteeuwen/go-bindata/...
WORKDIR /src
COPY ./go.mod ./go.sum ./
RUN go mod download
COPY . .
RUN make assets ui && cd cmd/writefreely && go build -v -tags='sqlite'
RUN mkdir -p \
/home/writefreely/static /home/writefreely/templates /home/writefreely/pages && \
cp -r templates/ pages/ static/ /home/writefreely
FROM alpine AS final
# TODO user nobody or similar
COPY --from=build /src/cmd/writefreely/writefreely /bin
COPY --from=build /home /home
EXPOSE 8080
WORKDIR /home/writefreely
ENTRYPOINT [ "writefreely" ]