Initial Commit
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
## 1. Builder
|
||||
# Use nodejs 10
|
||||
FROM node:10-alpine AS builder
|
||||
|
||||
# Load repository into container
|
||||
WORKDIR /rpdata-frontend
|
||||
COPY . .
|
||||
|
||||
# Setup development environment
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Erease all traces of browser-refresh
|
||||
RUN sed -i '/browser-refresh/d' ./marko/page/layout.marko
|
||||
RUN sed -i '/browser-refresh/d' ./package.json
|
||||
|
||||
# Install and compress node_modules
|
||||
RUN rm -rf node_modules
|
||||
RUN mkdir node_modules
|
||||
RUN npm install -g modclean
|
||||
RUN npm install
|
||||
RUN npm dedupe
|
||||
RUN modclean -r
|
||||
|
||||
# Remove dev stuff
|
||||
RUN rm -rf .static
|
||||
RUN rm -rf .cache
|
||||
RUN rm -rf .git
|
||||
|
||||
## 2. Regroup
|
||||
FROM node:10-alpine
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
# Bring data over from builder
|
||||
WORKDIR /rpdata-frontend
|
||||
COPY --from=builder /rpdata-frontend /rpdata-frontend
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Entry point
|
||||
CMD ["/usr/local/bin/node", "server"]
|
||||
Reference in New Issue
Block a user