Skip to content

Commit 1fe27ef

Browse files
committed
Add docker files so that anyone with docker can spin up hackfoldr
1 parent af08c9b commit 1fe27ef

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Dockerfile for development on local machine.
2+
#
3+
4+
FROM starefossen/ruby-node:2-6
5+
6+
WORKDIR /srv
7+
8+
RUN gem install compass --no-document && \
9+
gem install tilt --version "1.4.1" --no-document
10+
11+
ADD package.json ./
12+
RUN npm i
13+
CMD ["npm", "start"]

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,19 @@ Please go to this [cleaner new repo](https://github.com/hackfoldr/hackfoldr-2.0-
44

55
## Why?
66
We wiped-out all accidentally commited project specific files in the new repo, and decided to keep this repo for those projects.
7+
8+
## Development
9+
10+
To run hackfoldr on local machine, please install `docker` & `docker-compose` first, then run:
11+
12+
```
13+
$ docker-compose up
14+
```
15+
16+
This will spin up http://localhost:3000 using the latest code in the current directory.
17+
18+
If you update package.json, you will need to rebuild the base image using:
19+
20+
```
21+
$ docker-compose up --build
22+
```

docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: '2'
2+
3+
volumes:
4+
# node_modules in hackfoldr service goes to this named volume
5+
# so that local machine's node_modules are not messed up
6+
# https://stackoverflow.com/a/38601156
7+
node_modules:
8+
9+
services:
10+
hackfoldr:
11+
build:
12+
context: .
13+
volumes:
14+
- .:/srv
15+
# node_modules will use named volume instead of the one under current directory
16+
- node_modules:/srv/node_modules
17+
ports:
18+
- 3000:3000

0 commit comments

Comments
 (0)