Skip to content

Commit fd136ab

Browse files
committed
Fixed to work on docker
1 parent 97939af commit fd136ab

11 files changed

Lines changed: 66 additions & 11 deletions

File tree

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
client
2+
node_modules/**
3+
.key.scrt
4+
.scrt.env
5+
Dockerfile
6+
.editorconfig

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM alpine
2+
RUN apk add --update nodejs npm
3+
WORKDIR /usr/src/app
4+
COPY package*.json ./
5+
RUN npm ci --only=production
6+
COPY . .
7+
EXPOSE 3300
8+
CMD ["npm", "start"]

buildFrontEnd.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cd client
2+
ng build --optimization=true --aot=true --build-optimizer=true --configuration=production --output-hashing none &&
3+
docker build -t $1 .

client/src/app/pages/dashboard/dashboard.component.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class DashboardComponent implements OnInit {
2020
private windowService: NbWindowService,
2121
public datepipe: DatePipe
2222
) { }
23-
source: any = new LocalDataSource();
23+
source = new LocalDataSource();
2424

2525
show: boolean = false;
2626

@@ -31,10 +31,13 @@ export class DashboardComponent implements OnInit {
3131
getSerials(){
3232
this.face.getSerials().subscribe(
3333
res => {
34-
this.source = res['data']
35-
for(const data of this.source){
36-
data.expiracy = this.datepipe.transform(data.expiracy, 'MMM dd, yyyy');
34+
let dataTable = res['data']
35+
for(const data of dataTable){
36+
if(data.expiracy != 'Unlimited'){
37+
data.expiracy = this.datepipe.transform(data.expiracy, 'MMM dd, yyyy');
38+
}
3739
}
40+
this.source.load(dataTable)
3841
},
3942
err => console.error(err)
4043
)

client/src/environments/environment.prod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
export const environment = {
77
api: '/api',
88
production: true,
9+
SERIAL: 'th1s_isTh3+_secrt-4-encrypt10n(S3rVe85Ide)'
910
};

client/src/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<base href="/">
88

99
<meta name="viewport" content="width=device-width, initial-scale=1">
10-
<link rel="shortcut icon" href="/api/pictures/favicon1.ico">
11-
<link rel="icon" type="image/png" href="/api/pictures/favicon1.png">
12-
<link rel="icon" type="image/x-icon" href="/api/pictures/favicon1.ico">
10+
<link rel="shortcut icon" href="./assets/favicon1.ico">
11+
<link rel="icon" type="image/png" href="./assets/favicon1.png">
12+
<link rel="icon" type="image/x-icon" href="./assets/favicon1.ico">
1313
</head>
1414
<body>
1515
<ngx-app>Loading...</ngx-app>

docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '3'
2+
3+
services:
4+
serial-server:
5+
network_mode: host
6+
image: graymatics1/serial-back-end:1.0.2
7+
restart: always
8+
volumes:
9+
- /home/alex/Desktop/office/system/.scrt.env:/usr/src/app/.scrt.env
10+
11+
serial-ui:
12+
image: graymatics1/serial-front-end:1.0.4
13+
restart: always
14+
ports:
15+
- 80:80
16+
volumes:
17+
- /home/alex/Desktop/office/system/nginx.conf:/etc/nginx/conf.d/default.conf

nginx.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
index index.html;
6+
location / {
7+
try_files $uri $uri/ /index.html;
8+
}
9+
10+
location /api {
11+
proxy_pass http://172.19.0.1:3000;
12+
client_max_body_size 1G;
13+
}
14+
15+
error_page 500 502 503 504 /50x.html;
16+
location = /50x.html {
17+
root /usr/share/nginx/html;
18+
}
19+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serial-server",
3-
"version": "0.0.2",
3+
"version": "1.0.1",
44
"private": true,
55
"author": "Alex Ignacio Kaiser",
66
"scripts": {

src/bin/www

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ server.listen(port);
4343
server.on('error', onError);
4444
server.on('listening', onListening);
4545

46-
decide()
47-
4846
/**
4947
* Normalize a port into a number, string, or false.
5048
*/

0 commit comments

Comments
 (0)