Skip to content

Commit

Permalink
dockerize application (#188)
Browse files Browse the repository at this point in the history
In preparation for deploy. Dockerize the backend and frontend

---------

Co-authored-by: Anson He <[email protected]>
  • Loading branch information
victorzheng02 and ansonjwhe authored Feb 27, 2024
1 parent bf62289 commit cd92c91
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Setup Guide
# Setup Guide - LOCAL

After you clone the repository, run

Expand Down Expand Up @@ -118,6 +118,26 @@ cd frontend
npm start
```

# Docker setup

Assuming your .env files are configured properly, you can run them in docker containers as well.

## Docker setup - frontend

```
cd frontend
docker build -t wato-finance-frontend .
docker run -p 3000:3000 -d wato-finance-frontend
```

## Docker setup - backend

```
cd backend
docker build -t wato-finance-backend .
docker run -p 5000:5000 -d wato-finance-backend
```

---

## Notes
Expand Down
7 changes: 7 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:14
WORKDIR /usr/src/app/backend
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5000
CMD ["node", "server.js"]
7 changes: 7 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:14
WORKDIR /usr/src/app/frontend
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

0 comments on commit cd92c91

Please sign in to comment.