浏览代码

dont use it at home

Arkadiusz Lisiecki 5 年之前
父节点
当前提交
1a402caf30
共有 5 个文件被更改,包括 954 次插入9 次删除
  1. 2 1
      Dockerfile
  2. 4 2
      docker-compose.yml
  3. 10 4
      index.js
  4. 937 2
      package-lock.json
  5. 1 0
      package.json

+ 2 - 1
Dockerfile

@@ -16,4 +16,5 @@ RUN yarn install
 COPY --chown=node:node . .
 
 EXPOSE 3000
-CMD ["yarn", "dev"]
+# CMD ["yarn", "dev"]
+CMD ["tail", "-f", "/etc/passwd"]

+ 4 - 2
docker-compose.yml

@@ -11,7 +11,9 @@ services:
     volumes:
       - .:/home/node/app
       - node_modules:/home/node/app/node_modules
-    command: ["yarn", "dev"]
+    # command: ["yarn", "dev"]
+    # command: ["tail", "-f", "/etc/passwd"]
+    command: ["/home/node/app/node_modules/.bin/keystone", "--entry", "index.js"]
     links:
       - postgres
     ports:
@@ -99,4 +101,4 @@ networks:
     external: true
 
 volumes:
-  node_modules:
+  node_modules:

+ 10 - 4
index.js

@@ -68,13 +68,14 @@ const VatSchema = require('./schema/vat.js');
 //const Logger = require('@keystonejs/logger').logger('test');
 
 
-const initialiseData = require('./initial-data');
+// ??? const initialiseData = require('./initial-data');
 
 const { KnexAdapter: Adapter } = require('@keystonejs/adapter-knex');
 
 const PROJECT_NAME = 'SchuStock';
 const adapterConfig = { knexOptions: {
-    connection: 'postgresql://kdev_postgres:utnQ67pt74bVw6aB@postgres:5432/kdev_postgres',
+    //connection: 'postgresql://kdev_postgres:utnQ67pt74bVw6aB@postgres:5432/kdev_postgres',
+    connection: 'postgresql://kdev_postgres:utnQ67pt74bVw6aB@54.37.131.206:5432/kdev_postgres',
   }
 };
 
@@ -87,8 +88,9 @@ const { Wysiwyg } = require('@keystonejs/fields-wysiwyg-tinymce')
 
 const keystone = new Keystone({
   adapter: new Adapter(adapterConfig),
+  
   //onConnect: process.env.CREATE_TABLES !== 'true' && initialiseData,
-  onConnect: initialiseData,
+/// ????  onConnect: initialiseData,
   //secureCookies: false,
   /*
   cookie: {
@@ -101,11 +103,15 @@ const keystone = new Keystone({
   cookieSecret: 'dupa23',
   name: 'SchuStock',
   brand: 'Jubiler Schubert',
+//  port: 3000,
+//  host: '0.0.0.0',
   //sessionStore: new FileSessionStore({  }),
 });
 
 //keystone.set('signin logo', ['https://jubilerschubert.pl/wp-content/uploads/schubert_logo.svg', 180, 42]);
 
+//keystone.set('host', '0.0.0.0');
+
 // Access control functions
 const userIsAdmin = ({ authentication: { item: user } }) => Boolean(user && user.isAdmin);
 const userOwnsItem = ({ authentication: { item: user } }) => {
@@ -275,4 +281,4 @@ module.exports = {
   /*configureExpress: app => {
     app.set('trust proxy', true);
   }*/
-};
+};

文件差异内容过多而无法显示
+ 937 - 2
package-lock.json


+ 1 - 0
package.json

@@ -17,6 +17,7 @@
     "create-tables": "cross-env CREATE_TABLES=true keystone create-tables"
   },
   "dependencies": {
+    "@babel/core": "^7.11.6",
     "@keystonejs/adapter-knex": "^12.0.1",
     "@keystonejs/app-admin-ui": "^7.3.8",
     "@keystonejs/app-graphql": "^6.1.3",

部分文件因为文件数量过多而无法显示