-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Netmanager] Fixed typescript errors and added Dockerfile #2395
Changes from 5 commits
d6c0572
bdcba65
b31323e
39ccdad
9e7ff7b
39ca4bd
6e5b738
2aa8a4f
edaa282
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Use the official Node.js image as a base | ||
FROM node:18 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Expose the application port | ||
EXPOSE 3000 | ||
|
||
# Command to run the application | ||
CMD ["npm", "start"] | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,61 +1,23 @@ | ||||||||||||||||||||||||||||
export interface Grid { | ||||||||||||||||||||||||||||
_id: string; | ||||||||||||||||||||||||||||
visibility: boolean; | ||||||||||||||||||||||||||||
name: string; | ||||||||||||||||||||||||||||
admin_level: string; | ||||||||||||||||||||||||||||
network: string; | ||||||||||||||||||||||||||||
long_name: string; | ||||||||||||||||||||||||||||
createdAt: string; | ||||||||||||||||||||||||||||
sites: Site[]; | ||||||||||||||||||||||||||||
import { Site } from "./sites"; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
export interface CreateGrid { | ||||||||||||||||||||||||||||
name: string; | ||||||||||||||||||||||||||||
admin_level: string; | ||||||||||||||||||||||||||||
shape: { | ||||||||||||||||||||||||||||
type: "MultiPolygon" | "Polygon"; | ||||||||||||||||||||||||||||
coordinates: number[][][][]; | ||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
network: string; | ||||||||||||||||||||||||||||
Comment on lines
+6
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Clarify the The Apply this diff to adjust the export interface CreateGrid {
name: string;
admin_level: string;
- shape: {
- type: "MultiPolygon" | "Polygon";
- coordinates: number[][][][];
- };
+ shape:
+ | {
+ type: "Polygon";
+ coordinates: number[][][];
+ }
+ | {
+ type: "MultiPolygon";
+ coordinates: number[][][][];
+ };
network: string;
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
export interface Site { | ||||||||||||||||||||||||||||
export interface Grid { | ||||||||||||||||||||||||||||
_id: string; | ||||||||||||||||||||||||||||
isOnline: boolean; | ||||||||||||||||||||||||||||
formatted_name: string; | ||||||||||||||||||||||||||||
location_name: string; | ||||||||||||||||||||||||||||
search_name: string; | ||||||||||||||||||||||||||||
city: string; | ||||||||||||||||||||||||||||
district: string; | ||||||||||||||||||||||||||||
county: string; | ||||||||||||||||||||||||||||
region: string; | ||||||||||||||||||||||||||||
country: string; | ||||||||||||||||||||||||||||
latitude: number; | ||||||||||||||||||||||||||||
longitude: number; | ||||||||||||||||||||||||||||
visibility: boolean; | ||||||||||||||||||||||||||||
name: string; | ||||||||||||||||||||||||||||
approximate_latitude: number; | ||||||||||||||||||||||||||||
approximate_longitude: number; | ||||||||||||||||||||||||||||
generated_name: string; | ||||||||||||||||||||||||||||
data_provider: string; | ||||||||||||||||||||||||||||
description: string; | ||||||||||||||||||||||||||||
site_category: SiteCategory; | ||||||||||||||||||||||||||||
groups: string[]; | ||||||||||||||||||||||||||||
grids: Grid[]; | ||||||||||||||||||||||||||||
devices: Device[]; | ||||||||||||||||||||||||||||
airqlouds: unknown[]; | ||||||||||||||||||||||||||||
admin_level: string; | ||||||||||||||||||||||||||||
network: string; | ||||||||||||||||||||||||||||
long_name: string; | ||||||||||||||||||||||||||||
createdAt: string; | ||||||||||||||||||||||||||||
updatedAt?: string; | ||||||||||||||||||||||||||||
pm2_5?: number; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
interface SiteCategory { | ||||||||||||||||||||||||||||
tags: string[]; | ||||||||||||||||||||||||||||
area_name: string; | ||||||||||||||||||||||||||||
category: string; | ||||||||||||||||||||||||||||
highway: string; | ||||||||||||||||||||||||||||
landuse: string; | ||||||||||||||||||||||||||||
latitude: number; | ||||||||||||||||||||||||||||
longitude: number; | ||||||||||||||||||||||||||||
natural: string; | ||||||||||||||||||||||||||||
search_radius: number; | ||||||||||||||||||||||||||||
waterway: string; | ||||||||||||||||||||||||||||
sites: Site[]; | ||||||||||||||||||||||||||||
numberOfSites: number; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
export interface Device { | ||||||||||||||||||||||||||||
_id: string; | ||||||||||||||||||||||||||||
group: string; | ||||||||||||||||||||||||||||
authRequired: boolean; | ||||||||||||||||||||||||||||
serial_number: string; | ||||||||||||||||||||||||||||
api_code: string; | ||||||||||||||||||||||||||||
groups: string[]; | ||||||||||||||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add .dockerignore file.
Create a .dockerignore file to exclude unnecessary files from the build context:
🛠️ Refactor suggestion
Enhance Dockerfile with production best practices.
Consider the following improvements:
Here's an optimized version: