mirror of
https://github.com/caprover/caprover
synced 2025-10-30 10:07:01 +00:00
40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
FROM node:14
|
|
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 --production && \
|
|
npm cache clean --force && \
|
|
npm run build
|
|
|
|
|
|
|
|
|
|
# Build frontend code using a fixed hash commit.
|
|
|
|
ENV FRONTEND_COMMIT_HASH 8131e278e4febd6e435ccbbf678a229ba3329654
|
|
|
|
# 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 reset --hard ${FRONTEND_COMMIT_HASH} && \
|
|
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 ["npm" , "start"]
|