-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathDockerfile
51 lines (38 loc) · 1.04 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
FROM node:9-stretch as base
# Install packages needed on linux
RUN apt-get update && apt-get install -y \
apt-utils \
python2.7 \
python-dev \
python-pip \
build-essential \
libldap2-dev \
libssl-dev \
libsasl2-dev \
openjdk-8-jdk
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
ADD . /app
# Install packages from requirements.txt
RUN pip install --upgrade pip
RUN pip install -r 3rdparty/python/requirements.txt
# Install bower
RUN npm i -g bower
# Change directory to install bower packages
RUN cd static && bower install --allow-root
# Make port 5000 available outside the container
EXPOSE 5000
# Create the pex file
RUN ./pants clean-all binary :gatekeeper
# Import python and remove base container
FROM python:2.7.14
# Set the working directory to /app
WORKDIR /app
# Copy project files
ADD . /app
# Copy pex from base build
COPY --from=base /app/dist /app/dist
COPY --from=base /app/static /app/static
# Run gatekeeper.pex when container starts
CMD ["python", "dist/gatekeeper.pex"]