diff --git a/docker-compose-dev.yml b/docker-compose.yml similarity index 86% rename from docker-compose-dev.yml rename to docker-compose.yml index 655d3112..badb6b37 100644 --- a/docker-compose-dev.yml +++ b/docker-compose.yml @@ -17,8 +17,8 @@ services: ports: - 5001:5000 environment: - - DATABASE_URL=postgres://postgres:postgres@api-db:5432/mpwo - - DATABASE_TEST_URL=postgres://postgres:postgres@api-db:5432/mpwo_test + - DATABASE_URL=postgres://postgres:postgres@mpwo-db:5432/mpwo + - DATABASE_TEST_URL=postgres://postgres:postgres@mpwo-db:5432/mpwo_test - FLASK_APP=server.py - FLASK_DEBUG=1 - APP_SETTINGS=mpwo_api.config.DevelopmentConfig diff --git a/mpwo_api/Dockerfile b/mpwo_api/Dockerfile index 9e706603..796a1bda 100644 --- a/mpwo_api/Dockerfile +++ b/mpwo_api/Dockerfile @@ -1,17 +1,19 @@ FROM python:3.6.3 +MAINTAINER SamR1 + # set working directory RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # add requirements -ADD ./requirements.txt /usr/src/app/mpwo_api/requirements.txt +COPY ./requirements.txt /usr/src/app/mpwo_api/requirements.txt # install requirements RUN pip install -r mpwo_api/requirements.txt # add app -ADD . /usr/src/app +COPY . /usr/src/app # run server CMD flask run --with-threads -h 0.0.0.0 diff --git a/mpwo_api/db/Dockerfile b/mpwo_api/db/Dockerfile index 25cd4153..959ea547 100644 --- a/mpwo_api/db/Dockerfile +++ b/mpwo_api/db/Dockerfile @@ -1,3 +1,5 @@ -FROM postgres +FROM postgres:10.1 -ADD create.sql /docker-entrypoint-initdb.d +MAINTAINER SamR1 + +COPY create.sql /docker-entrypoint-initdb.d diff --git a/mpwo_client/Dockerfile b/mpwo_client/Dockerfile index 9ce640d6..7c2af3ab 100644 --- a/mpwo_client/Dockerfile +++ b/mpwo_client/Dockerfile @@ -1,4 +1,6 @@ -FROM node:latest +FROM node:9.4.0 + +MAINTAINER SamR1 # set working directory RUN mkdir /usr/src/app @@ -14,12 +16,12 @@ ENV NODE_ENV $NODE_ENV ENV REACT_APP_API_URL $REACT_APP_API_URL # install and cache app dependencies -ADD package.json /usr/src/app/package.json +COPY package.json /usr/src/app/package.json RUN yarn install --silent RUN yarn global add react-scripts # add app -ADD . /usr/src/app/ +COPY . /usr/src/app/ # start app CMD yarn start diff --git a/mpwo_client/src/utils.js b/mpwo_client/src/utils.js index ff0e1371..a2c9a5c1 100644 --- a/mpwo_client/src/utils.js +++ b/mpwo_client/src/utils.js @@ -1,13 +1,10 @@ - - export const isLoggedIn = () => !!window.localStorage.authToken export function generateIds(arr) { let i = 0 - let arrWithIds = arr.map(arr => { - const obj = { id: i, value: arr } + return arr.map(val => { + const obj = { id: i, value: val } i++ return obj }) - return arrWithIds } diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 743e91ac..9f970904 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -1,4 +1,6 @@ FROM nginx:1.13.0 +MAINTAINER SamR1 + RUN rm /etc/nginx/conf.d/default.conf -ADD /nginx.conf /etc/nginx/conf.d +COPY /nginx.conf /etc/nginx/conf.d