Client: Dockerfile init
This commit is contained in:
parent
279fb9bbea
commit
1a6ae7c159
@ -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
|
||||
|
@ -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';
|
||||
|
25
mpwo_client/Dockerfile-dev
Normal file
25
mpwo_client/Dockerfile-dev
Normal 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"]
|
Loading…
Reference in New Issue
Block a user