Browse Source

Docker volume for db

master
Archie Baer 2 weeks ago
parent
commit
eee49de5c0
3 changed files with 5 additions and 2 deletions
  1. 1
    1
      app.js
  2. 1
    0
      data/info.md
  3. 3
    1
      docker-compose.yml

+ 1
- 1
app.js View File

@@ -7,7 +7,7 @@ const config = yaml.parse(fs.readFileSync(__dirname + "/config.yml", "utf8"));

//NeDB
const nedb = require("nedb");
const posts = new nedb({ filename: __dirname + "/posts.db", autoload: true });
const posts = new nedb({ filename: __dirname + "/data/posts.db", autoload: true });

//Express
const express = require("express");

+ 1
- 0
data/info.md View File

@@ -0,0 +1 @@
This is the docker volume where the database will be stored

+ 3
- 1
docker-compose.yml View File

@@ -4,4 +4,6 @@ services:
blog:
build: .
ports:
- 8081:80
- 8081:80
volumes:
- ./data:/usr/src/app/data

Loading…
Cancel
Save