This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile
63 lines (54 loc) · 1.82 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM ubuntu:14.04
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Set debconf to run non-interactively
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Install base dependencies
RUN apt-get update && apt-get install -y -q --no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
curl \
git \
libssl-dev \
python \
rsync \
&& rm -rf /var/lib/apt/lists/*
# Install nvm with node and npm
# http://stackoverflow.com/questions/25899912/install-nvm-in-docker
ENV NVM_DIR /usr/local/nvm
RUN mkdir -p $NVM_DIR
ENV NODE_VERSION 10
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV PATH $NVM_BIN:$PATH
# Go ahead and install nodemon for convenience while developing
RUN source $NVM_DIR/nvm.sh
###########################
# App-specific stuff
# mongo uses kerberos
RUN apt-get update && apt-get install -y libkrb5-dev
# Install NPM dependencies. Do this first so that if package.json hasn't
# changed we don't have to re-run npm install during `docker build`
COPY package.json /app/package.json
WORKDIR /app
RUN source $NVM_DIR/nvm.sh; npm install
# Copy the app
COPY ["newrelic.js", ".eslintrc", ".eslintignore", ".babelrc", "knexfile.js", "index.js", "/app/"]
COPY ["app.js", "/app/"]
COPY lib /app/lib/
COPY test /app/test/
COPY api /app/api/
COPY config /app/config/
COPY migrations /app/migrations/
COPY seeds /app/seeds/
#############################
# develop helper script and entrypoint
#
RUN source $NVM_DIR/nvm.sh
ADD .build_scripts/entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]