-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile
56 lines (41 loc) · 1019 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# Stage 1: build dev center
#
FROM ubuntu:20.04 as dev-center-builder
# Prevent below apt-get line from requiring user interaction
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
openssl \
ruby \
ruby-dev \
git \
zlib1g-dev \
cmake \
build-essential \
g++ \
libffi-dev
RUN gem install bundler:2.2.14
WORKDIR /opt/builds
COPY . .
RUN bundle install
RUN ./build.sh
#
# Final stage: use the build artifacts from previous stages
#
FROM node:17.3-buster-slim
WORKDIR /opt/src/app
COPY --from=dev-center-builder /opt/builds/sites ./sites
COPY server/index.js ./server/index.js
COPY server/prometheus.js ./server/prometheus.js
COPY config ./config
COPY package.json yarn.lock ./
RUN yarn --frozen-lockfile --production
# Add deployment artifacts to the image.
ADD deploy /opt/algorithmia/service/deploy
# Add algo user with appropriate UID
RUN adduser --uid 1001 algo
USER algo
EXPOSE 3000
ENTRYPOINT [ "node", "server/index.js" ]