codacy issues fix

This commit is contained in:
SamR1 2018-01-14 17:19:02 +01:00
parent ec37423dfc
commit a51f2869bf
6 changed files with 20 additions and 15 deletions

View File

@ -17,8 +17,8 @@ services:
ports: ports:
- 5001:5000 - 5001:5000
environment: environment:
- DATABASE_URL=postgres://postgres:postgres@api-db:5432/mpwo - DATABASE_URL=postgres://postgres:postgres@mpwo-db:5432/mpwo
- DATABASE_TEST_URL=postgres://postgres:postgres@api-db:5432/mpwo_test - DATABASE_TEST_URL=postgres://postgres:postgres@mpwo-db:5432/mpwo_test
- FLASK_APP=server.py - FLASK_APP=server.py
- FLASK_DEBUG=1 - FLASK_DEBUG=1
- APP_SETTINGS=mpwo_api.config.DevelopmentConfig - APP_SETTINGS=mpwo_api.config.DevelopmentConfig

View File

@ -1,17 +1,19 @@
FROM python:3.6.3 FROM python:3.6.3
MAINTAINER SamR1
# set working directory # set working directory
RUN mkdir -p /usr/src/app RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
# add requirements # add requirements
ADD ./requirements.txt /usr/src/app/mpwo_api/requirements.txt COPY ./requirements.txt /usr/src/app/mpwo_api/requirements.txt
# install requirements # install requirements
RUN pip install -r mpwo_api/requirements.txt RUN pip install -r mpwo_api/requirements.txt
# add app # add app
ADD . /usr/src/app COPY . /usr/src/app
# run server # run server
CMD flask run --with-threads -h 0.0.0.0 CMD flask run --with-threads -h 0.0.0.0

View File

@ -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

View File

@ -1,4 +1,6 @@
FROM node:latest FROM node:9.4.0
MAINTAINER SamR1
# set working directory # set working directory
RUN mkdir /usr/src/app RUN mkdir /usr/src/app
@ -14,12 +16,12 @@ ENV NODE_ENV $NODE_ENV
ENV REACT_APP_API_URL $REACT_APP_API_URL ENV REACT_APP_API_URL $REACT_APP_API_URL
# install and cache app dependencies # 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 install --silent
RUN yarn global add react-scripts RUN yarn global add react-scripts
# add app # add app
ADD . /usr/src/app/ COPY . /usr/src/app/
# start app # start app
CMD yarn start CMD yarn start

View File

@ -1,13 +1,10 @@
export const isLoggedIn = () => !!window.localStorage.authToken export const isLoggedIn = () => !!window.localStorage.authToken
export function generateIds(arr) { export function generateIds(arr) {
let i = 0 let i = 0
let arrWithIds = arr.map(arr => { return arr.map(val => {
const obj = { id: i, value: arr } const obj = { id: i, value: val }
i++ i++
return obj return obj
}) })
return arrWithIds
} }

View File

@ -1,4 +1,6 @@
FROM nginx:1.13.0 FROM nginx:1.13.0
MAINTAINER SamR1
RUN rm /etc/nginx/conf.d/default.conf RUN rm /etc/nginx/conf.d/default.conf
ADD /nginx.conf /etc/nginx/conf.d COPY /nginx.conf /etc/nginx/conf.d