Skip to content

Commit

Permalink
Added Docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
ourwarmhouse committed Feb 5, 2018
1 parent b921d5f commit 4575318
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
.*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
data/
config/settings.json
.vscode
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM mhart/alpine-node:8

ENV NODE_VERSION 8.9.4

WORKDIR /var/expressCart

COPY bin/ /var/expressCart/bin/
COPY config/ /var/expressCart/config/
COPY public/ /var/expressCart/public/
COPY routes/ /var/expressCart/routes/
COPY views/ /var/expressCart/views/

COPY app.js /var/expressCart/
COPY package.json /var/expressCart/
COPY gulpfile.js /var/expressCart/

RUN npm install

VOLUME /var/expressCart/data

EXPOSE 1111
ENTRYPOINT ["npm", "start"]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ Keeping expressCart running after closing the terminal can be done in a few ways

> Note: Node.js version 7.x or greater is needed.
### Docker

The easiest way to get up and running is using Docker. Once the Docker CLI is installed from [https://www.docker.com/get-docker](https://www.docker.com/get-docker).

1. Enter the root of the expressCart application
2. Run: `docker-compose up --build`
3. Visit [http://127.0.0.1:1111](http://127.0.0.1:1111) in your browser

## Admin

Visit: [http://127.0.0.1:1111/admin](http://127.0.0.1:1111/admin)
Expand Down
2 changes: 1 addition & 1 deletion config/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"customCss": ".footer{padding-top: 5px;}",
"currencySymbol": "£",
"paymentGateway": "stripe",
"databaseConnectionString": "mongodb://expresscart:[email protected]:39909/expresscart",
"databaseConnectionString": "mongodb://127.0.0.1:27017/expresscart",
"theme": "Cloth"
}
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3'
services:
expresscart:
image: "node:8"
build: .
container_name: "expresscart"
environment:
NODE_ENV: development
NODE_PATH: /
ports:
- "1111:1111"
links:
- mongodb
depends_on:
- mongodb
mongodb:
image: mongo:latest
container_name: "mongodb"
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
# - MONGODB_USER="user"
# - MONGODB_PASS="pass"
volumes:
- ./data/db:/data/db
ports:
- 27017:27017
command: mongod --smallfiles --logpath=/dev/null

0 comments on commit 4575318

Please sign in to comment.