Skip to content

Commit 4691e4d

Browse files
authored
Merge branch 'master' into table_for_file
2 parents 9b3f914 + 9a7a2ec commit 4691e4d

29 files changed

+2731
-85
lines changed

GettingStarted.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@
55
- Install Docker Compose - `https://docs.docker.com/compose/install/`
66

77
## Running everything (server and client)
8-
98
- navigate to src directory `cd .../PAWS-DATA-PIPELINE/src`
109
- docker compose `docker-compose up`
1110
- access the client going to `http://localhost:3000`
11+
## Running the client (front-end) locally
12+
- navigate to src directory `cd .../PAWS-DATA-PIPELINE/src`
13+
- docker compose `docker-compose run server`
14+
- start the frontend with the proxy`npm run start:local`
1215

13-
## Running just the client (front-end)
14-
15-
- navigate to src directory `cd .../PAWS-DATA-PIPELINE/src/client`
16-
- docker compose `docker-compose up`
17-
- access the client going to `http://localhost:3000`
18-
19-
## Running just the server (back-end)
20-
21-
- navigate to src directory `cd .../PAWS-DATA-PIPELINE/src/server`
22-
- docker compose `docker-compose up`
16+
## Running just server (back-end) locally
17+
- navigate to src directory `cd .../PAWS-DATA-PIPELINE/src`
18+
- set the PAWS_API_HOST=localhost or your ip in `docker-compose.yml`
19+
- docker compose `docker-compose up` and stop the server

src/client/Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pull official base image
2-
FROM node:13.12.0-alpine
2+
FROM node:13.12.0-alpine as builder
33

44
# set working directory
55
WORKDIR /app
@@ -13,8 +13,15 @@ COPY package-lock.json ./
1313

1414
RUN npm install --silent
1515

16+
COPY public ./public
17+
COPY src ./src
18+
19+
RUN npm run build
20+
1621
# add app
17-
COPY . ./
22+
FROM nginx:latest AS host
23+
24+
# COPY nginx-client.conf /etc/nginx/conf.d/default.conf
25+
COPY default.conf.template /etc/nginx/templates/
1826

19-
# start app
20-
CMD ["npm", "start"]
27+
COPY --from=builder /app/build/ /usr/share/nginx/html

src/client/default.conf.template

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
upstream backend {
2+
#server paws-compose-server:5000;
3+
server ${PAWS_API_HOST}:5000;
4+
}
5+
6+
server {
7+
listen 80;
8+
server_name localhost;
9+
client_max_body_size 100M;
10+
11+
location / {
12+
root /usr/share/nginx/html;
13+
index index.html index.htm;
14+
}
15+
16+
location /api {
17+
try_files $uri @backend;
18+
}
19+
20+
location @backend {
21+
proxy_pass http://backend;
22+
proxy_set_header X-Real-IP $remote_addr;
23+
proxy_set_header Host $host;
24+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25+
proxy_read_timeout 3600;
26+
proxy_connect_timeout 3600;
27+
proxy_send_timeout 3600;
28+
send_timeout 3600;
29+
# Following is necessary for Websocket support
30+
# proxy_http_version 1.1;
31+
# proxy_set_header Upgrade $http_upgrade;
32+
# proxy_set_header Connection "upgrade";
33+
}
34+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 62 additions & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)