Files
caprover/dockerfile-captain.release
T

32 lines
616 B
Plaintext

FROM node:10
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Build backend code
COPY . /usr/src/app
RUN npm install && npm cache clean --force
RUN npm run build
# Build frontend code using a fixed hash commit
ENV FRONTEND_COMMIT_HASH 8c0b603b29bde8ed76ece12f7ece06f8d00bcfda
RUN git clone https://github.com/githubsaturn/caprover-frontend.git && \
cd caprover-frontend && \
git reset --hard ${FRONTEND_COMMIT_HASH} && \
npm install && npm cache clean --force && \
npm run build && \
mv ./build ../dist-frontend
ENV NODE_ENV production
ENV PORT 3000
EXPOSE 3000
CMD ["npm" , "start"]