Files
snippet-box/Dockerfile.arm
2021-09-23 17:28:28 +02:00

34 lines
563 B
Docker

FROM node:14-alpine
WORKDIR /app
COPY package*.json ./
RUN apk --no-cache --virtual build-dependencies add python make g++ \
&& npm install
COPY . .
RUN mkdir -p ./public ./data
# Build server code
RUN npm run build
# Build client code
RUN cd ./client \
&& npm install --production \
&& npm run build \
&& cd .. \
&& mv ./client/build/* ./public
# Clean up src files
RUN rm -rf src/ ./client \
&& npm prune --production \
&& apk del build-dependencies
EXPOSE 5000
ENV NODE_ENV=production
CMD ["node", "build/server.js"]