You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
902 B

# Note: this Dockerfile is written to be executed with the whole source
# as its context.
# TODO remove client source
# TODO material UI (and other libs) from CSN
FROM node:12-alpine
# Install base dependencies
WORKDIR /usr/src/mudbase
COPY package*.json ./
RUN npm install --only=production
# Install back-end dependencies
WORKDIR /usr/src/mudbase/server
COPY server/package*.json ./
RUN npm install --only=production
# Install front-end dependencies
WORKDIR /usr/src/mudbase/client
COPY client/package*.json ./
RUN npm install --only=production
# Install front-end
WORKDIR /usr/src/mudbase/client
COPY client/ ./
ENV REACT_APP_BACKEND "/api"
RUN npm run-script build
# Install back-end
WORKDIR /usr/src/mudbase/server
COPY server/ ./
# Start
WORKDIR /usr/src/mudbase/server
EXPOSE 8080
ENV PORT 8080
ENV API "/api"
ENV FRONTEND_PREFIX "/"
ENV FRONTEND "../client/build"
CMD [ "npm", "start" ]