forked from parse-community/parse-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (39 loc) · 1.18 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
############################################################
# Build stage
############################################################
FROM node:20.17.0-alpine3.20 AS build
RUN apk --no-cache add \
build-base \
git \
python3
WORKDIR /tmp
# Copy package.json first to benefit from layer caching
COPY package*.json ./
# Copy src to have config files for install
COPY . .
# Install without scripts
RUN npm ci --omit=dev --ignore-scripts \
# Copy production node_modules aside for later
&& cp -R node_modules prod_node_modules \
# Install all dependencies
&& npm ci \
# Run build steps
&& npm run build
############################################################
# Release stage
############################################################
FROM node:20.17.0-alpine3.20 AS release
VOLUME /parse-server/cloud /parse-server/config
WORKDIR /parse-server
# Copy build stage folders
COPY --from=build /tmp/prod_node_modules /parse-server/node_modules
COPY --from=build /tmp/lib lib
COPY package*.json ./
COPY bin bin
COPY public_html public_html
COPY views views
RUN mkdir -p logs && chown -R node: logs
ENV PORT=1337
USER node
EXPOSE $PORT
ENTRYPOINT ["node", "./bin/parse-server"]