diff --git a/Dockerfile b/Dockerfile index 9e0f73b6e7e95d2ec7de171229844d02047ea900..4444fbeef0b12d2df59a07dbf85e849ddff8832a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ FROM node:10.15.3-alpine +# Create app directory RUN mkdir /opt/app && chown node:node /opt/app RUN apk add --update git && \ rm -rf /tmp/* /var/cache/apk/* -# Create app directory WORKDIR /opt/app USER node @@ -22,8 +22,10 @@ COPY .babelrc ./ # Bundle app source COPY src ./src +# Run the scripts defined in package.json RUN npm install && npm run build EXPOSE 3001 +# Express server handles the backend functionality and also serves the React app CMD ["node", "dist/server"]