Skip to content

Commit

Permalink
Dockerize
Browse files Browse the repository at this point in the history
  • Loading branch information
Dereje1 committed Sep 8, 2021
1 parent 31d1d6d commit 3a6c4c4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
package-lock.json
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Get image
FROM node:14
#Assign workdir and copy all files
WORKDIR /tmp
COPY . .
#Install packages and build client
RUN npm install
RUN npm run build
#Expose default port and run
EXPOSE 3000
CMD [ "node", "./bin/www" ]
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ https://dereje-pclone.herokuapp.com/

![Screenshot (45)](https://user-images.githubusercontent.com/23533048/56138593-34949880-5f65-11e9-8507-e4cb12e6bcce.png)

## Getting Started

# Getting Started
# A) Local
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites
Expand Down Expand Up @@ -60,6 +60,20 @@ $ npm run dev
```
You can now go to `http://localhost:8080/` and see the project running in dev mode.

# B) Docker
If you have docker installed and a `.env` file with contents from above, then from the root dir:
1. Build the img
```
docker build . -t pintclone
```
2. Run the image
```
docker run -p 80:3000 pintclone
```
3. Go to `http://localhost/`

<br/>

## Built With

* [MongoDB](https://www.mongodb.com/) - Database
Expand Down

0 comments on commit 3a6c4c4

Please sign in to comment.