mirror of https://github.com/writeas/writefreely
A focused writing and publishing space.
https://write.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
888 B
36 lines
888 B
FROM golang:1.12-alpine AS build
|
|
|
|
RUN apk add --update 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 cd cmd/writefreely && go build -v -tags='sqlite'
|
|
RUN make assets ui
|
|
|
|
RUN mkdir -p \
|
|
/home/writefreely/static /home/writefreely/templates /home/writefreely/pages && \
|
|
cp -r templates/ pages/ static/ /home/writefreely && \
|
|
cp config.ini.example /home/writefreely/config.ini
|
|
|
|
FROM alpine AS dev
|
|
|
|
COPY --from=build /src/cmd/writefreely/writefreely /bin
|
|
COPY --from=build /home /home
|
|
|
|
EXPOSE 8080
|
|
WORKDIR /home/writefreely
|
|
ENTRYPOINT [ "writefreely" ]
|
|
|
|
FROM alpine AS prod
|
|
|
|
|
|
RUN apk add ca-certificates openssl
|
|
COPY --from=dev . .
|
|
|
|
EXPOSE 80 443
|
|
WORKDIR /home/writefreely
|
|
ENTRYPOINT [ "writefreely" ] |