forked from caprover/caprover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile-captain.edge
43 lines (31 loc) · 1.31 KB
/
dockerfile-captain.edge
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
38
39
40
41
42
43
FROM node:18
RUN apt-get update && apt-get full-upgrade -yqq && apt-get install build-essential cmake -yqq
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Build backend code
COPY . /usr/src/app
RUN npm ci && \
npm cache clean --force && \
npm run build && \
mv ./edge-override.json ./config-override.json
# Build frontend code.
# This quick hack invalidates the cache.
ADD https://www.google.com /time.now
ENV FRONTEND_COMMIT_HASH 1ff9807e1185d0c7f6fbce0bc4939cd4d42f3bfa
# armV7 fails: https://github.com/yarnpkg/yarn/issues/5259 https://github.com/nodejs/docker-node/issues/1335
# RUN curl -Iv https://registry.yarnpkg.com/@ant-design/icons-svg/-/icons-svg-4.1.0.tgz && \
RUN curl -Iv https://registry.yarnpkg.com/ && \
mkdir -p /usr/src/app-frontend && cd /usr/src/app-frontend && \
git clone https://github.com/githubsaturn/caprover-frontend.git && \
cd caprover-frontend && \
git reset --hard ${FRONTEND_COMMIT_HASH} && \
git log --max-count=1 && \
yarn install --no-cache --frozen-lockfile --network-timeout 600000 && echo "Installation finished" && \
yarn run build && echo "Building finished" && \
mv ./build ../../app/dist-frontend && \
cd / && \
rm -rf /usr/src/app-frontend
ENV NODE_ENV production
ENV PORT 3000
EXPOSE 3000
CMD ["node" , "./built/server.js"]