-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (48 loc) · 1.35 KB
/
Dockerfile
File metadata and controls
63 lines (48 loc) · 1.35 KB
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
# Node Building Image
FROM node:20
# Install Python and required packages
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /opt/api
# Install app dependencies
COPY package*.json ./
COPY .sequelizerc ./
COPY .snyk ./
# Setup logging
RUN touch winston.log.json
RUN yarn cache clean
# Get environment argument passed in
ARG environment
ARG default_environment=development
# Set NODE_ENV environment variable
ENV NODE_ENV=${environment:-$default_environment}
# Set SNYK TOKEN environment variable
ARG SNYK_TOKEN
ENV SNYK_TOKEN=${SNYK_TOKEN}
RUN yarn global add snyk@latest
RUN snyk auth "$SNYK_TOKEN"
# Check environment and install dependencies
RUN yarn install
# Create and activate Python virtual environment
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Install ML package in virtual environment
RUN pip3 install git+https://github.com/GSA/srt-ml.git@dev
# Bundle app source
COPY server/ ./server
# Get Login.gov Certs
COPY bin/copy_certs.sh ./
COPY certs/ ./certs
ARG LOGIN_PRIVATE_KEY
ENV LOGIN_PRIVATE_KEY=${LOGIN_PRIVATE_KEY}
RUN /opt/api/copy_certs.sh
# See https://docs.cloudfoundry.org/devguide/deploy-apps/push-docker.html
COPY docker/conf/passwd /etc/passwd
# Expose port
EXPOSE 8080
# Start app
CMD [ "node", "server/server.js" ]