-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.prod
42 lines (31 loc) · 1.15 KB
/
Dockerfile.prod
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
# Start with the official MongoDB image
FROM mongo:latest
# Install Node.js and Git
RUN apt-get update && \
apt-get install -y curl gnupg git && \
curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs
# Install yarn globally
RUN npm install -g yarn
# Install pm2 globally
RUN yarn global add pm2
# Copy in mailserver dependencies
COPY mailserver/package.json /React-TrashMail/mailserver/
COPY mailserver/yarn.lock /React-TrashMail/mailserver/
COPY mailserver/node_modules /React-TrashMail/mailserver/node_modules
# Copy the rest of the application code
COPY . /React-TrashMail
# Copy built React app to mailserver build directory
COPY react/build /React-TrashMail/mailserver/build
# Define mountable volume
VOLUME ["/React-TrashMail/mailserver/attachments"]
# Copy startup script
COPY docker_start.sh /docker_start.sh
RUN chmod +x /docker_start.sh
# Set the health check
COPY healthcheck.sh /healthcheck.sh
RUN chmod +x /healthcheck.sh
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD /healthcheck.sh
# Set the command to start the application using the startup script
CMD ["/docker_start.sh"]