-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2395 from airqo-platform/migrate-netmanager
[Netmanager] Fixed typescript errors and added Dockerfile
- Loading branch information
Showing
18 changed files
with
836 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.git | ||
.gitignore | ||
node_modules | ||
.next | ||
.env* | ||
npm-debug.log* | ||
README.md | ||
.vscode | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Use the official Node.js image as a base | ||
FROM node:18-alpine AS builder | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package*.json ./ | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
RUN npm ci | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
# Add healthcheck | ||
HEALTHCHECK --interval=30s --timeout=3s \ | ||
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1 | ||
|
||
USER node | ||
|
||
# Expose the application port | ||
EXPOSE 3000 | ||
|
||
# Command to run the application | ||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
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[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.