mirror of
https://github.com/caprover/caprover
synced 2026-05-03 18:20:32 +00:00
43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
FROM node:14-alpine
|
|
|
|
RUN apk update && apk upgrade && \
|
|
apk add --no-cache bash git openssh openssl python python3 curl
|
|
|
|
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
|
|
|
|
# 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 && \
|
|
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 && \
|
|
yarn install --no-cache --frozen-lockfile --production --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 ["npm" , "start"]
|