mirror of
https://github.com/caprover/caprover
synced 2026-05-04 02:30:30 +00:00
35 lines
799 B
Plaintext
35 lines
799 B
Plaintext
FROM node:14
|
|
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 c28107f530ef23a87aee503cc2ac815a822edeee
|
|
|
|
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 reset --hard ${FRONTEND_COMMIT_HASH} && \
|
|
yarn install --frozen-lockfile --production && yarn cache clean --all && \
|
|
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"]
|