forked from bcgov/indy-vdr-proxy-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (29 loc) · 853 Bytes
/
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
# Setup
FROM node:18-buster AS base
# Setup env variable for yarn
ENV YARN_VERSION=4.3.1
# Update dependencies, add python to the base image, install and use yarn 4.x
RUN apt-get update && \
apt-get install python3=3.7.3-1 && \
corepack enable && \
corepack prepare yarn@${YARN_VERSION}
# Create app directory
WORKDIR /app
# Copy source code into app folder
COPY . .
# Build server
FROM base AS builder
# Fix for node-gyp issues (Yarn 4 doesn't do global installs), install deps and remove created cache, run build
RUN npm install -g node-gyp && \
yarn install --immutable && \
yarn cache clean && \
yarn build
# Run server
FROM builder AS runner
# Create a volume for the Credo agent data, allow read write access
RUN mkdir /var/credo && \
chmod 777 /var/credo
# Expose port
EXPOSE 3000
# Run server
CMD ["node", "dist/main.js"]