Skip to content

Commit e06b26d

Browse files
committed
fix skf Docker local
1 parent fea4ef4 commit e06b26d

File tree

5 files changed

+9
-25
lines changed

5 files changed

+9
-25
lines changed

Docker/alpine/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ RUN groupadd --gid 1000 user_skf && useradd --uid 1000 --gid user_skf -m user_sk
2424

2525
ADD ./ /home/user_skf/
2626
RUN chmod a+rw /home/user_skf/skf/db /home/user_skf/skf/db/*
27-
COPY ./Docker/alpine/skf-angular.sh /skf-angular.sh
2827
COPY ./Docker/alpine/entrypoint.sh /entrypoint.sh
2928
COPY ./Docker/alpine/skf-api.sh /skf-api.sh
3029
COPY ./Docker/alpine/wrapper.sh /wrapper.sh
@@ -42,8 +41,10 @@ RUN apt update &&\
4241
openssl
4342

4443
WORKDIR /home/user_skf/Angular
45-
RUN npm install -g @angular/cli > /dev/null
46-
RUN npm install
44+
RUN perl -pi -e "s/http:\/\/127.0.0.1:8888\/api/https:\/\/localhost\/api/" /home/user_skf/Angular/src/environments/environment.ts
45+
46+
RUN npm --loglevel=error install &&\
47+
npm run build --prod
4748

4849
EXPOSE 443 80
4950

Docker/alpine/site-tls.conf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ server {
2222
ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256';
2323
ssl_prefer_server_ciphers on;
2424

25-
root /home/user_skf/Angular;
25+
root /home/user_skf/Angular/dist;
2626
charset utf-8;
2727

2828
location / {
29-
proxy_pass http://localhost:4200;
29+
try_files $uri $uri/ /index.html =404;
3030
proxy_http_version 1.1;
31-
proxy_set_header Upgrade $http_upgrade;
32-
proxy_set_header Connection 'upgrade';
33-
proxy_set_header Host $host;
34-
proxy_cache_bypass $http_upgrade;
3531
}
3632

3733
location /api/ {

Docker/alpine/site.conf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33
server {
44
listen 80 default_server;
55

6-
root /home/user_skf/Angular;
6+
root /home/user_skf/Angular/dist;
77
charset utf-8;
88

99
location / {
10-
proxy_pass http://localhost:4200;
10+
try_files $uri $uri/ /index.html =404;
1111
proxy_http_version 1.1;
12-
proxy_set_header Upgrade $http_upgrade;
13-
proxy_set_header Connection 'upgrade';
14-
proxy_set_header Host $host;
15-
proxy_cache_bypass $http_upgrade;
1612
}
1713

1814
location /api/ {

Docker/alpine/skf-angular.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

Docker/alpine/wrapper.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ fi
2424

2525
while /bin/true; do
2626
PROCESS_1_STATUS=$(ps aux |grep -q skf-api* |grep -v grep)
27-
PROCESS_2_STATUS=$(ps aux |grep -q skf-angular* | grep -v grep)
2827
# If the greps above find anything, they will exit with 0 status
2928
# If they are not both 0, then something is wrong
30-
if [[ $PROCESS_1_STATUS -ne '0' || $PROCESS_2_STATUS -ne '0' ]]; then
29+
if [[ $PROCESS_1_STATUS -ne '0' ]]; then
3130
echo "One of the processes has already exited."
3231
exit -1
3332
fi

0 commit comments

Comments
 (0)