Skip to content

Commit

Permalink
Added proper interfaces and fixed docker healthcheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitkonikov committed Feb 9, 2024
1 parent 31985a8 commit 284277a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
13 changes: 12 additions & 1 deletion backend/src/models/file.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import mongoose from 'mongoose';

const schema = new mongoose.Schema({
// Define File interface
export interface IFile extends Document {
filepath: string;
link: string;
title: string;
description: string;
published: Date;
playlist: mongoose.Schema.Types.ObjectId,
thumbnail: mongoose.Schema.Types.ObjectId,
}

const schema = new mongoose.Schema<IFile>({
filepath: String,
link: String,
title: String,
Expand Down
8 changes: 7 additions & 1 deletion backend/src/models/thumbnail.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import mongoose from 'mongoose';

const schema = new mongoose.Schema({
// Define Thumbnail interface
export interface IThumbnail extends Document {
title: string;
filepath: string;
}

const schema = new mongoose.Schema<IThumbnail>({
title: String,
filepath: String,
});
Expand Down
9 changes: 8 additions & 1 deletion backend/src/models/trailer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import mongoose from 'mongoose';

const schema = new mongoose.Schema({
// Define Thumbnail interface
export interface ITrailer extends Document {
filepath: string;
visible: boolean;
film: mongoose.Schema.Types.ObjectId;
}

const schema = new mongoose.Schema<ITrailer>({
filepath: String,
visible: Boolean,
film: { type: mongoose.Schema.Types.ObjectId, ref: 'File' },
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
networks:
- gateway_app-net
healthcheck:
test: ["CMD", "curl", "-f", "http://backend:3000/admin"]
test: ["CMD", "curl", "-f", "http://backend:3000/cinefolio/admin"]
interval: 30s
timeout: 10s
retries: 5
Expand Down

0 comments on commit 284277a

Please sign in to comment.