-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (40 loc) · 1.7 KB
/
Dockerfile
File metadata and controls
55 lines (40 loc) · 1.7 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
ARG NODE_VER="14"
#LABEL authors="Stefan Walther"
# -------------------------------------------------------------------
# BASE NODE
# -------------------------------------------------------------------
# We need full node as we need git to download from some GitHub repos.
# -------------------------------------------------------------------
# We cannot use -alpine straight ahead since we need the git package.
FROM node:${NODE_VER} as base
WORKDIR /opt/verb
RUN npm install -g verbose/verb#dev verbose/verb-generate-readme
## -------------------------------------------------------------------
## TEST
## -------------------------------------------------------------------
FROM base as test
RUN mkdir /opt/verb/test
COPY ./test /opt/verb/test
RUN ./test/test-verb.sh
## -------------------------------------------------------------------
## RELEASE
## -------------------------------------------------------------------
FROM node:${NODE_VER}-alpine as release
RUN apk update
RUN apk add bash
# Enables colored output
ENV FORCE_COLOR=true
WORKDIR /opt/verb
# OK, here we have to copy the symbolic link
# use npm config get prefix to get the node.js prefix https://stackoverflow.com/questions/18383476/how-to-get-the-npm-global-path-prefix
# COPY --from=BASE /usr/local/bin/verb /usr/local/bin/verb
# Create the symbolic link
RUN ln -s /usr/local/lib/node_modules/verb/bin/verb.js /usr/local/bin/verb
# Copy the global packages previously being installed
COPY --from=base /usr/local/lib/node_modules /usr/local/lib/node_modules
ADD ./scripts/start.sh /
RUN chmod +x /start.sh
CMD ["/start.sh"]
# Fix
#RUN rm -f ./README.md
#CMD ["verb"]