forked from caprover/caprover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile-captain.edge
40 lines (27 loc) · 887 Bytes
/
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
FROM node:14-alpine
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh openssl
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Build backend code
COPY . /usr/src/app
RUN npm ci --production && \
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
RUN mkdir -p /usr/src/app-frontend && cd /usr/src/app-frontend && \
git clone https://github.com/githubsaturn/caprover-frontend.git && \
cd caprover-frontend && \
git log --max-count=1 && \
npm ci --production && npm cache clean --force && \
npm run build && \
mv ./build ../../app/dist-frontend && \
cd / && \
rm -rf /usr/src/app-frontend
ENV NODE_ENV production
ENV PORT 3000
EXPOSE 3000
CMD ["npm" , "start"]