-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (31 loc) · 1.14 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
# EYEWITNESS UI - PRODUCTION DOCKERFILE
# Use the official node base image and allow upgrades to any new minor version on redeploy.
FROM node:10
MAINTAINER Atchai <[email protected]>
ENV NODE_ENV=production
# Prepare the software inside the container.
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
ntp \
&& rm -rf /var/lib/apt/lists/*
# ^^ Keep the image size down by removing the packages list.
# Fix the time inside the container by starting the ntp service and setting the timezone.
RUN ntpd -gq && service ntp start
RUN echo Europe/London >/etc/timezone && dpkg-reconfigure -f noninteractive tzdata
# Ensure we run commands inside the correct directory.
WORKDIR /src
# Install our dependencies.
COPY package.json /src/package.json
COPY package-lock.json /src/package-lock.json
COPY webpack.config.js /src/webpack.config.js
RUN npm install --dev
# Add all our application files.
COPY app /src/app
# Build the application frontend.
RUN npm run build
# Remove any non-production dependencies.
RUN npm install --production
RUN rm -f /src/webpack.config.js
# Run the application.
CMD ["npm", "run", "start-production"]