Skip to content

Commit 7454a2b

Browse files
committed
Dockerfile added with minimal alpine linux and basic packages + Readme updated
1 parent e5674bb commit 7454a2b

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

Diff for: Dockerfile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM alpine:3.4
2+
3+
# File Author / Maintainer
4+
LABEL authors="Zouhir Chahoud <[email protected]>"
5+
6+
# Update & install required packages
7+
RUN apk add --update nodejs bash git
8+
9+
# Install app dependencies
10+
COPY package.json /www/package.json
11+
RUN cd /www; npm install
12+
13+
# Copy app source
14+
COPY . /www
15+
16+
# Set work directory to /www
17+
WORKDIR /www
18+
19+
# set your port
20+
ENV PORT 8080
21+
22+
# expose the port to outside world
23+
EXPOSE 8080
24+
25+
# start command as per package.json
26+
CMD ["npm", "start"]

Diff for: README.md

+21
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,29 @@ PORT=8080 npm run dev
3131

3232
# Start production server:
3333
PORT=8080 npm start
34+
```
35+
Docker Support
36+
------
37+
```sh
38+
cd express-es6-rest-api
39+
40+
# Build your docker
41+
docker build -t es6/api-service .
42+
# ^ ^ ^
43+
# tag tag name Dockerfile location
44+
45+
# run your docker
46+
docker run -p 8080:8080 es6/api-service
47+
# ^ ^
48+
# bind the port container tag
49+
# to your host
50+
# machine port
51+
3452
```
3553

54+
Docker Demo
55+
-------------------------
56+
It's supposed to be pretty easy to take your Docker to your favourite cloud service, here's a demo of what's our Dockerized bolierplate is like: [https://docker-deployment-yudfxfiaja.now.sh/api](https://docker-deployment-yudfxfiaja.now.sh/api)
3657

3758
License
3859
-------

0 commit comments

Comments
 (0)