First Dockerfile and build script that yields a working container. No config yet, and all runs in dev mode.
parent
aca50c7c62
commit
26a59e419c
13 changed files with 18342 additions and 2330 deletions
@ -0,0 +1,3 @@ |
|||||||
|
node_modules |
||||||
|
client/node_modules |
||||||
|
server/node_modules |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,41 @@ |
|||||||
|
# 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" ] |
@ -0,0 +1,10 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
SCRIPT=`realpath $0` |
||||||
|
SCRIPTPATH=`dirname $SCRIPT` |
||||||
|
|
||||||
|
pushd "$SCRIPTPATH/.." |
||||||
|
|
||||||
|
docker build . -f deploy/Dockerfile -t mudbase:latest |
||||||
|
|
||||||
|
popd |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue