diff --git a/Dockerfile b/Dockerfile index 044fe96..824906d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,10 @@ WORKDIR / COPY ./src /src COPY ./package*.json ./ -COPY ./gulpfile.js ./ -COPY ./ormconfig.json ./ RUN npm install RUN npm install -g gulp RUN npm install gulp RUN gulp EXPOSE 4000 - -CMD ["npm", "start"] \ No newline at end of file +CMD ["npm", "start"] diff --git a/ormconfig.json b/ormconfig.json deleted file mode 100644 index 250b347..0000000 --- a/ormconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "postgres", - "host": "127.17.42.1", - "port": 5432, - "username": "apollo", - "database": "apollo_test", - "synchronize": true, - "logging": false, - "entities": [ - "dist/model/**/*.js" - ] - } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 1d0e8fb..01c7797 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import { createConnection } from 'typeorm'; import { UserServerAPI } from './datasources/userserver/userserviceAPI'; import express from 'express'; import { requiredPermissions } from './datasources/userserver/permission'; +import { CargoBike } from './model/CargoBike'; require('dotenv').config(); @@ -37,7 +38,15 @@ async function authenticate (req: any, res: any, next: any) { } } -createConnection().then(async () => { +createConnection({ + type: 'postgres', + url: process.env.POSTGRES_CONNECTION_URL, + entities: [ + CargoBike + ], + synchronize: true, + logging: false +}).then(async () => { console.log('connected to db'); }).catch(error => console.log(error));