forked from OctoFarm/OctoFarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonolithic.Dockerfile
37 lines (29 loc) · 1.12 KB
/
monolithic.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
FROM node:14.16-stretch
# Update Local Repository Index
RUN apt-get update
# Upgrade packages in the base image and apply security updates
RUN DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -yq
# Install package utils
RUN DEBIAN_FRONT=noninteractive apt-get install -yq apt-utils
# Install MongoDB
RUN DEBIAN_FRONT=noninteractive apt-get install -yq ca-certificates
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add
RUN echo 'deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.4 main' | tee /etc/apt/sources.list.d/mongodb.list
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq mongodb-org
# Remove package files fetched for install
RUN apt-get clean
# Remove unwanted files
RUN rm -rf /var/lib/apt/lists/
COPY . /app
WORKDIR /app/server
ENV NODE_ENV=production
ENV MONGO=mongodb://127.0.0.1:27017/octofarm
RUN npm install -g npm@latest
RUN npm install -g pm2
RUN npm ci --omit=dev
EXPOSE 4000
WORKDIR /app
COPY docker/monolithic-entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["bash", "/usr/local/bin/entrypoint.sh"]