Skip to content

Commit 627132a

Browse files
author
Dan Kelley
committed
added env to set the backend server
1 parent dc5729e commit 627132a

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

src/client/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WORKDIR /app
66

77
# add `/app/node_modules/.bin` to $PATH
88
ENV PATH /app/node_modules/.bin:$PATH
9-
9+
# ENV PAWS_API_HOST paws-compose-server
1010
# install app dependencies
1111
COPY package.json ./
1212
COPY package-lock.json ./
@@ -17,9 +17,11 @@ COPY public ./public
1717
COPY src ./src
1818

1919
RUN npm run build
20+
2021
# add app
21-
FROM nginx AS host
22+
FROM nginx:latest AS host
2223

23-
COPY nginx-client.conf /etc/nginx/conf.d/default.conf
24+
# COPY nginx-client.conf /etc/nginx/conf.d/default.conf
25+
COPY default.conf.template /etc/nginx/templates/
2426

2527
COPY --from=builder /app/build/ /usr/share/nginx/html

src/client/nginx-client.conf renamed to src/client/default.conf.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
upstream backend {
2-
server paws-compose-server:5000;
2+
#server paws-compose-server:5000;
3+
server ${PAWS_API_HOST}:5000;
34
}
45

56
server {

src/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ services:
2020
- db
2121
volumes:
2222
- src_archive:/app/static/raw_data
23-
environment:
24-
FLASK_ENV: development
25-
23+
environment:
24+
- FLASK_ENV=development
2625

2726
client:
2827
build: ./client
@@ -33,6 +32,7 @@ services:
3332
- server
3433
environment:
3534
- CHOKIDAR_USEPOLLING=true
35+
- PAWS_API_HOST=paws-compose-server
3636
stdin_open: true
3737

3838
#using named volumes fixs a windows docker bug relating to container permissions

src/server/wsgi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from app import create_app
2+
3+
app = create_app()
4+
5+
if __name__ == "__main__":
6+
app.run()

0 commit comments

Comments
 (0)