Skip to content

Commit

Permalink
更新 Dockerfile #644
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed Apr 23, 2024
1 parent 74efb62 commit dc6ad9f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
31 changes: 20 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
FROM node:18 as NODE_BUILD
WORKDIR /go/src/github.com/Hi-Windom/Sillot/
ADD . /go/src/github.com/Hi-Windom/Sillot/
RUN cd app && npm install -g pnpm && pnpm install --registry=http://registry.npmjs.org/ --silent && pnpm run docker:build
FROM node:20 as NODE_BUILD
WORKDIR /Hi-Windom/Sillot/
ADD . /Hi-Windom/Sillot/
RUN cd app && \

Check notice on line 4 in Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Dockerfile#L4

Use semicolon or linefeed before 'then' (or quote to make it literal).
packageManager=$(jq -r '.packageManager' package.json) && \
if [ -n "$packageManager" ] then \
npm install -g $packageManager \
else \
echo "No packageManager field found in package.json" && \
npm install -g pnpm \
fi && \
pnpm install --registry=http://registry.npmjs.org/ --silent && \
pnpm run docker:build

FROM golang:alpine as GO_BUILD
WORKDIR /go/src/github.com/Hi-Windom/Sillot/
COPY --from=NODE_BUILD /go/src/github.com/Hi-Windom/Sillot/ /go/src/github.com/Hi-Windom/Sillot/
WORKDIR /Hi-Windom/Sillot/
COPY --from=NODE_BUILD /Hi-Windom/Sillot/ /Hi-Windom/Sillot/
ENV GO111MODULE=on
ENV CGO_ENABLED=1
RUN apk add --no-cache gcc musl-dev && \
cd kernel && go build --tags fts5 -v -ldflags "-s -w -X github.com/Hi-Windom/Sillot/kernel/util.Mode=prod" && \
mkdir /opt/Sillot/ && \
mv /go/src/github.com/Hi-Windom/Sillot/app/appearance/ /opt/Sillot/ && \
mv /go/src/github.com/Hi-Windom/Sillot/app/stage/ /opt/Sillot/ && \
mv /go/src/github.com/Hi-Windom/Sillot/app/guide/ /opt/Sillot/ && \
mv /go/src/github.com/Hi-Windom/Sillot/app/changelogs/ /opt/siyuan/ && \
mv /go/src/github.com/Hi-Windom/Sillot/kernel/kernel /opt/Sillot/ && \
mv /Hi-Windom/Sillot/app/appearance/ /opt/Sillot/ && \
mv /Hi-Windom/Sillot/app/stage/ /opt/Sillot/ && \
mv /Hi-Windom/Sillot/app/guide/ /opt/Sillot/ && \
mv /Hi-Windom/Sillot/app/changelogs/ /opt/siyuan/ && \
mv /Hi-Windom/Sillot/kernel/kernel /opt/Sillot/ && \
find /opt/Sillot/ -name .git | xargs rm -rf

FROM alpine:latest
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sillot",
"version": "0.31.1000",
"version": "0.31.1100",
"syv": "3.0.11",
"sypv": "[]",
"description": "Build Your Eternal Digital Garden",
Expand Down

0 comments on commit dc6ad9f

Please sign in to comment.