Client: Dockerfile init

This commit is contained in:
SamR1 2018-01-07 22:10:25 +01:00
parent 279fb9bbea
commit 1a6ae7c159
3 changed files with 42 additions and 0 deletions

View File

@ -29,3 +29,18 @@ services:
- db
links:
- db
client:
container_name: client
build:
context: ./
dockerfile: ./mpwo_client/Dockerfile-dev
args:
- NODE_ENV=development
- REACT_APP_USERS_SERVICE_URL=${REACT_APP_USERS_SERVICE_URL}
ports:
- 3007:3000
depends_on:
- api
links:
- api

View File

@ -1,3 +1,5 @@
DROP DATABASE IF EXISTS mpwo;
DROP DATABASE IF EXISTS mpwo_test;
CREATE DATABASE mpwo;
CREATE DATABASE mpwo_test;
CREATE USER mpwo WITH PASSWORD 'mpwo';

View File

@ -0,0 +1,25 @@
FROM node:latest
# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# add environment variables
ARG REACT_APP_USERS_SERVICE_URL
ARG NODE_ENV
ENV NODE_ENV $NODE_ENV
ENV REACT_APP_USERS_SERVICE_URL $REACT_APP_USERS_SERVICE_URL
# install and cache app dependencies
ADD package.json /usr/src/app/package.json
RUN npm install --silent
RUN npm install react-scripts -g
# add app
ADD . /usr/src/app/
# start app
CMD ["npm", "start"]