forked from renovatebot/renovate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.slim
79 lines (51 loc) · 1.61 KB
/
Dockerfile.slim
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Base image
#============
FROM renovate/yarn:1.21.1@sha256:6aeeab4a40e4687a961ab8bcefb2fa4ce374c4f0324cc40d37fbcecbfac4af0c AS base
LABEL maintainer="Rhys Arkins <rhys@arkins.net>"
LABEL name="renovate"
LABEL org.opencontainers.image.source="https://github.com/renovatebot/renovate"
WORKDIR /usr/src/app/
# required for install
USER root
RUN chown -R ubuntu:ubuntu /usr/src/app/
# and back to normal
USER ubuntu
# Build image
#============
FROM base as tsbuild
USER root
# Python 2 and make are required to build node-re2
RUN apt-get update && apt-get install -y python-minimal build-essential
USER ubuntu
COPY package.json .
COPY yarn.lock .
RUN yarn install --frozen-lockfile
COPY lib lib
COPY tsconfig.json tsconfig.json
COPY tsconfig.app.json tsconfig.app.json
RUN yarn build:docker
# Prune node_modules to production-only so they can be copied into the final image
RUN yarn install --production --frozen-lockfile
# Final image
#============
FROM base as final
# required for install
USER root
# Docker client and group
RUN groupadd -g 999 docker
RUN usermod -aG docker ubuntu
ENV DOCKER_VERSION=19.03.1
RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
&& tar xzvf docker-${DOCKER_VERSION}.tgz --strip 1 \
-C /usr/local/bin docker/docker \
&& rm docker-${DOCKER_VERSION}.tgz
# and back to normal
USER ubuntu
COPY package.json .
COPY --from=tsbuild /usr/src/app/dist dist
COPY --from=tsbuild /usr/src/app/node_modules node_modules
COPY bin bin
COPY data data
ENV RENOVATE_BINARY_SOURCE=docker
ENTRYPOINT ["node", "/usr/src/app/dist/renovate.js"]
CMD []