dockerfile + package.json pour serveur bdd
continuous-integration/drone/push Build is passing Details

CI/CD
Thomas Chazot 7 months ago
parent b7eeff29f8
commit 5cbc92834c

@ -0,0 +1,22 @@
# Use the official Node.js image
FROM node:14
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm install
COPY ./DB/socialgraph.db .
# Copy the rest of the application code
COPY . .
# Expose the port that the application will run on
EXPOSE 3003
# Command to run the application
CMD ["node", "server.js"]

@ -0,0 +1,12 @@
{
"name": "cryptide",
"version": "1.0.0",
"dependencies": {
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"express": "^4.18.2",
"express-session": "^1.17.3",
"sqlite3": "^5.1.6"
}
}

@ -4,7 +4,7 @@ const cors = require('cors');
const bodyParser = require('body-parser');
const crypto = require('crypto');
const path = require('path');
const authRoutes = require(path.resolve(__dirname, './routes/authRoutes'));
const authRoutes = require(path.resolve(__dirname, './routes/AuthRoutes'));
const DatabaseService = require(path.resolve(__dirname, './services/DatabaseService'));
@ -14,7 +14,7 @@ const port = 3003;
// Middleware
app.use(cors(
{
origin: ["http://172.20.10.4:3000", "http://localhost:3000"],
origin: ["http://172.20.10.4:3000", "http://localhost:8080", "*"],
credentials: true
}
)); // Autoriser les requêtes cross-origin

@ -12,7 +12,7 @@ class DatabaseService {
// ----------------------------------------------------
async connect(client){
const dbPath = path.resolve(__dirname, `../../../db/${this.db_name}.db`)
const dbPath = path.resolve(__dirname, `../DB/${this.db_name}.db`)
return new Promise((resolve, reject) => {
this.client = new sqlite3.Database(dbPath,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save