diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f27c917 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.env +.git +.gitignore +node_modules +npm-debug.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c12a5ee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +#using Node v10 +FROM node:10 + +# Create app directory +WORKDIR /usr/src/lafs + +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json ./ + +RUN npm install +# If you are building your code for production +# RUN npm ci --only=production + +# Bundle app source +COPY . . + +# Expose port 3000 outside container +EXPOSE 3000 +# Command used to start application +CMD npm run start diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..857f5a2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: '3.7' +services: +# REST API running on Node JS container + app: + container_name: lafs-api + restart: always + build: . + ports: + - '3000:3000' +# link this container to the Mongo DB container + links: + - mongo +# pass in environment variables for database host and name + environment: + - DB_HOST=mongo + - DB_NAME=lafs-db +# Mongo DB storage container + mongo: + container_name: lafs-db + image: 'mongo:4' + ports: + - '27017:27017' +# Attach the external network to these containers +networks: + default: + external: + name: lafs-net diff --git a/explorer b/explorer new file mode 100644 index 0000000..4fa3dfe --- /dev/null +++ b/explorer @@ -0,0 +1,52 @@ + + + + + + LoopBack API Explorer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
 
+
+
+ + diff --git a/explorer.1 b/explorer.1 new file mode 100644 index 0000000..4fa3dfe --- /dev/null +++ b/explorer.1 @@ -0,0 +1,52 @@ + + + + + + LoopBack API Explorer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
 
+
+
+ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..82612d5 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +{"started":"2025-01-14T18:44:58.256Z","uptime":2.779} \ No newline at end of file diff --git a/index.html.1 b/index.html.1 new file mode 100644 index 0000000..4fa3dfe --- /dev/null +++ b/index.html.1 @@ -0,0 +1,52 @@ + + + + + + LoopBack API Explorer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
 
+
+
+ + diff --git a/index.html.2 b/index.html.2 new file mode 100644 index 0000000..9c94060 --- /dev/null +++ b/index.html.2 @@ -0,0 +1 @@ +{"started":"2025-01-14T20:43:59.880Z","uptime":65.334} \ No newline at end of file diff --git a/index.html.3 b/index.html.3 new file mode 100644 index 0000000..5411b9b --- /dev/null +++ b/index.html.3 @@ -0,0 +1 @@ +{"started":"2025-01-14T20:51:30.374Z","uptime":33.828} \ No newline at end of file diff --git a/server/datasources.development.js b/server/datasources.development.js index 05c14ba..dc9eddd 100644 --- a/server/datasources.development.js +++ b/server/datasources.development.js @@ -1,11 +1,12 @@ module.exports = { - mongodb: { - connector: 'mongodb', - hostname: process.env.DB_HOST, - port: process.env.DB_PORT, - user: process.env.DB_USER, - password: process.env.DB_PASSWORD, - database: process.env.DB_NAME, - url: process.env.DB_URL - } + mongodb: { + connector: 'mongodb', + hostname: process.env.DB_HOST || 'localhost', + port: process.env.DB_PORT || 27017, + user: process.env.DB_USER || '', + password: process.env.DB_PASSWORD || '', + database: process.env.DB_NAME || 'lafs', + url: process.env.DB_URL + } }; +