[feat] Init code

This commit is contained in:
JasonWu
2021-08-31 18:24:42 +08:00
commit b1e9c5e62a
57 changed files with 17957 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
# syntax=docker/dockerfile:experimental
FROM node:14.14.0 as deps
USER root
WORKDIR /data
COPY package.json yarn.lock ./
#RUN apk add --no-cache git openssh-client
RUN mkdir -p /root/.ssh
RUN echo "Host git.lawsnote.com\n\tStrictHostKeyChecking no\n\tUser git\n\tHostname git.lawsnote.com\n\tPort 2222\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config
# SSH key is set in docker build argument, ex: docker build --ssh default="$SSH_PRIVATE_KEY"
RUN --mount=type=ssh yarn install --frozen-lockfile
FROM node:14.14.0-slim
WORKDIR /data
ARG CI_COMMIT_SHA
COPY . .
COPY --from=deps /data/node_modules ./node_modules/
#RUN apk add --no-cache ffmpeg \
# && chown -R node:node .
RUN chown -R node:node . \
&& sed -i "s/__CI_COMMIT_SHA__/$CI_COMMIT_SHA/" ./public/html/version.html
USER node
CMD ["yarn", "start"]