Skip to content

Commit 6ec3251

Browse files
author
Dan Kelley
committed
working on nginx for frontend
1 parent 0b64db5 commit 6ec3251

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

src/client/Dockerfile

Lines changed: 9 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,13 @@ 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
1620
# add app
17-
COPY . ./
21+
FROM nginx AS host
22+
23+
COPY nginx-client.conf /etc/nginx/conf.d/default.conf
1824

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

src/client/src/pages/About.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ export default function About(props){
55
return (
66
<Container>
77
<Container style={{"padding":"1em"}}>
8-
<h1><a href="phillypaws.org">
8+
<h1><a href="https://phillypaws.org/">
99
The Philadelphia Animal Welfare Society(PAWS)
1010
</a></h1>
11-
<p>As the city’s largest animal rescue partner and no-kill animal shelter, the <a href="phillypaws.org">Philadelphia
11+
<p>As the city’s largest animal rescue partner and no-kill animal shelter, the <a href="https://phillypaws.org/">Philadelphia
1212
Animal Welfare Society (PAWS)</a> is working to make Philadelphia a place where every healthy and treatable pet is
1313
guaranteed a home. Since inception over 10 years ago, PAWS has rescued and placed 27,000+ animals in adoptive and
1414
foster homes, and has worked to prevent pet homelessness by providing 86,000+ low-cost spay/neuter services and

src/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
build: ./client
2929
container_name: paws-compose-client
3030
ports:
31-
- "3000:3000"
31+
- "3000:80"
3232
depends_on:
3333
- server
3434
environment:

src/server/api/admin_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ def __allowed_file(filename):
2626
# file upload tutorial
2727
@admin_api.route("/api/file", methods=["POST"])
2828
def uploadCSV():
29+
current_app.logger.info("Uploading CSV")
2930
if "file" not in request.files:
30-
return redirect(request.url)
31+
return jsonify({"error": "no file supplied"});
3132

3233
for file in request.files.getlist("file"):
3334
if __allowed_file(file.filename):
@@ -38,7 +39,7 @@ def uploadCSV():
3839
finally:
3940
file.close()
4041

41-
return redirect("/")
42+
return jsonify({"success": "uploaded file"});
4243

4344

4445
@admin_api.route("/api/files/<destination>", methods=["GET"])

0 commit comments

Comments
 (0)