-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
44 lines (35 loc) · 1.04 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
FROM node:18-alpine as dev
LABEL author="Paolo Pustorino <paolo.pustorino@sparkfabrik.com>"
RUN apk add --no-cache tini
# Variables
ENV INSTALL_DIR=/opt/raneto
ENV PORT=80
# Set current working directory
WORKDIR $INSTALL_DIR
# Copy content and configuration
COPY ./custom/server.js ./
COPY ./custom/package* ./
COPY ./custom/config.js ./config.js
COPY ./custom/themes ./themes
COPY ./content ./content
COPY ./assets ./assets
COPY ./custom/patches ./patches
# Expose port 80
EXPOSE $PORT
# Configure the entrypoint script
COPY build/node/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
CMD ["npm", "run", "start"]
ENTRYPOINT ["tini", "--", "/entrypoint.sh"]
FROM dev as prod
WORKDIR /opt/raneto
# Production build, must be all moved in a shared script.
RUN cd themes/spark-playbook && \
npm install && \
npm run build && \
cd /opt/raneto && \
npm install && \
npm run postinstall
# This should be moved before instaoll, but for some reasons it breaks the build.
# We just use it now for the entrypoint.
ENV NODE_ENV=production