-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
37 lines (36 loc) · 1.28 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ARG NODE_VERSION=10
FROM node:${NODE_VERSION}-alpine
RUN apk add --no-cache make gcc g++ python bash
WORKDIR /home/theia
# 注意:plugin和 extension并不在docker中再次编译,故在docker build前一定注意要在本目录编译好plugin和 extension
ADD ./ ./
RUN yarn --pure-lockfile && \
# yarn config set registry https://registry.npm.taobao.org/ &&\
yarn --production && \
yarn build && \
yarn autoclean --init && \
echo *.ts >> .yarnclean && \
echo *.ts.map >> .yarnclean && \
echo *.spec.* >> .yarnclean && \
yarn autoclean --force && \
rm -rf ./node_modules/electron && \
yarn cache clean
FROM node:${NODE_VERSION}-alpine
RUN addgroup theia && \
adduser -G theia -s /bin/sh -D theia;
RUN chmod g+rw /home && \
mkdir -p /home/project && \
chown -R theia:theia /home/theia && \
chown -R theia:theia /home/project;
RUN apk add --no-cache git openssh bash
ENV HOME /home/theia
WORKDIR /home/theia
COPY --from=0 --chown=theia:theia /home/theia /home/theia
EXPOSE 3000
ENV SHELL /bin/bash
ENV USE_LOCAL_GIT true
# 指定 plugin 路径
ENV THEIA_PLUGINS local-dir:./plugins/tinylink
USER theia
# ENTRYPOINT [ "yarn" , "start" , "plugin"]
ENTRYPOINT [ "node", "/home/theia/browser-app/src-gen/backend/main.js", "/home/project", "--hostname=0.0.0.0" ]