2018-04-24 19:19:33 +00:00
|
|
|
# Node.js + build dependencies + runtime dependencies
|
2017-11-25 11:01:30 +00:00
|
|
|
FROM thumbsupgallery/build:alpine
|
2017-11-24 10:55:26 +00:00
|
|
|
|
2018-06-12 20:58:45 +00:00
|
|
|
# Switch to a non-root user
|
|
|
|
# So we can test edge-cases around file permissions
|
|
|
|
RUN adduser -D tester
|
|
|
|
RUN chown -R tester:tester /app
|
|
|
|
USER tester
|
|
|
|
|
2017-11-25 11:01:30 +00:00
|
|
|
# Install and cache dependencies
|
2018-06-12 20:58:45 +00:00
|
|
|
COPY --chown=tester package.json /app
|
2017-11-25 11:01:30 +00:00
|
|
|
RUN npm install
|
2017-11-24 10:55:26 +00:00
|
|
|
|
2018-06-12 20:58:45 +00:00
|
|
|
# Copy the entire source code
|
|
|
|
COPY --chown=tester . /app
|
|
|
|
|
2017-11-25 11:01:30 +00:00
|
|
|
# Run the tests
|
2018-07-20 23:07:54 +00:00
|
|
|
RUN npm test
|