Files
kami-parse-server/Dockerfile

54 lines
1.1 KiB
Docker
Raw Normal View History

############################################################
# Build stage
############################################################
FROM node:lts-alpine as build
RUN apk update; \
apk add git;
WORKDIR /tmp
# Copy package.json first to benefit from layer caching
COPY package*.json ./
# Copy src to have config files for install
COPY . .
# Clean npm cache; added to fix an issue with the install process
2021-10-13 01:59:51 +02:00
RUN npm cache clean --force
# Install all dependencies
RUN npm ci
# Run build steps
RUN npm run build
############################################################
# Release stage
############################################################
FROM node:lts-alpine as release
2019-07-28 16:52:19 -05:00
RUN apk update; \
apk add git;
VOLUME /parse-server/cloud /parse-server/config
WORKDIR /parse-server
COPY package*.json ./
2019-06-06 18:11:07 -05:00
# Clean npm cache; added to fix an issue with the install process
2021-10-13 01:46:01 +02:00
RUN npm cache clean --force
2019-06-12 19:39:07 -05:00
RUN npm ci --production --ignore-scripts
COPY bin bin
COPY public_html public_html
COPY views views
COPY --from=build /tmp/lib lib
RUN mkdir -p logs && chown -R node: logs
ENV PORT=1337
USER node
EXPOSE $PORT
ENTRYPOINT ["node", "./bin/parse-server"]