forked from Trustroots/trustroots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (42 loc) · 1.36 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
FROM node:14
# Install prerequisites
# https://docs.docker.com/engine/articles/dockerfile_best-practices/#apt-get
# Base image should also have these already installed: gcc, git, make, python
# - `build-essential` and `make` are required by some Node modules
# - `unzip` & `wget` are required by API docs generator
RUN apt-get -qq update && apt-get -q install -y \
build-essential \
graphicsmagick \
openssl \
unzip \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Create working directory
RUN mkdir -p /trustroots
WORKDIR /trustroots
# Copies the local package.json and package-lock.json files to the container
# and utilities docker container cache to not needing to rebuild
# and install node_modules/ every time we build the docker, but only
# when the local package.json file changes.
# Install npm packages
COPY package*.json ./
RUN npm ci --quiet
# Set environment variables
ENV NODE_ENV development
ENV DB_1_PORT_27017_TCP_ADDR mongodb
# Share local directory on the docker container
# ...therefore the previous docker "layer" thats been cached will be used if possible
COPY . /trustroots
# Expose ports
# - Maildev 1080
# - Webpack-dev-server 3000
# - Nodemon server 3001
# - Node debug 5858
# - MongoDB 27017
EXPOSE 1080
EXPOSE 3000
EXPOSE 3001
EXPOSE 5858
EXPOSE 27017
CMD ["npm", "start"]