-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
34 lines (27 loc) · 1.18 KB
/
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
FROM node:latest
MAINTAINER Andrew Cutler <[email protected]>
EXPOSE 3000
ENV STRIDER_VERSION=v1.10.0 STRIDER_GIT_SRC=https://github.com/Strider-CD/strider.git STRIDER_HOME=/data STRIDER_SRC=/opt/strider
ENV NODE_ENV production
RUN useradd --comment "Strider CD" --home ${STRIDER_HOME} strider && mkdir -p ${STRIDER_HOME} && chown strider:strider ${STRIDER_HOME}
VOLUME [ "$STRIDER_HOME" ]
RUN mkdir -p $STRIDER_SRC && cd $STRIDER_SRC && \
# Checkout into $STRIDER_SRC
git clone $STRIDER_GIT_SRC . && \
[ "$STRIDER_VERSION" != 'master' ] && git checkout tags/$STRIDER_VERSION || git checkout master && \
rm -rf .git && \
# Install NPM deps
npm install && \
# FIX: https://github.com/Strider-CD/strider/pull/1056
npm install [email protected] &&\
# Create link to strider home dir so the modules can be used as a cache
mv node_modules node_modules.cache && ln -s ${STRIDER_HOME}/node_modules node_modules && \
# Allow strider user to update .restart file
chown strider:strider ${STRIDER_SRC}/.restart && \
# Cleanup Upstream cruft
rm -rf /tmp/*
ENV PATH ${STRIDER_SRC}/bin:$PATH
COPY entry.sh /
USER strider
ENTRYPOINT ["/entry.sh"]
CMD ["strider"]