mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
42 lines
900 B
Docker
42 lines
900 B
Docker
FROM openstf/base:v1.0.6
|
|
|
|
# Sneak the stf executable into $PATH.
|
|
ENV PATH /app/bin:$PATH
|
|
|
|
# Work in app dir by default.
|
|
WORKDIR /app
|
|
|
|
# Export default app port, not enough for all processes but it should do
|
|
# for now.
|
|
EXPOSE 3000
|
|
|
|
# Copy app source.
|
|
COPY . /tmp/build/
|
|
|
|
# Give permissions to our build user.
|
|
RUN mkdir -p /app && \
|
|
chown -R stf-build:stf-build /tmp/build /app
|
|
|
|
# Switch over to the build user.
|
|
USER stf-build
|
|
|
|
# Run the build.
|
|
RUN set -x && \
|
|
cd /tmp/build && \
|
|
export PATH=$PWD/node_modules/.bin:$PATH && \
|
|
npm install --loglevel http && \
|
|
npm pack && \
|
|
tar xzf stf-*.tgz --strip-components 1 -C /app && \
|
|
bower cache clean && \
|
|
npm prune --production && \
|
|
mv node_modules /app && \
|
|
npm cache clean && \
|
|
rm -rf ~/.node-gyp && \
|
|
cd /app && \
|
|
rm -rf /tmp/*
|
|
|
|
# Switch to the app user.
|
|
USER stf
|
|
|
|
# Show help by default.
|
|
CMD stf --help
|