-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(docker): add initial docker configuration
build(docker): update naming and add Makefile
- Loading branch information
1 parent
b3e9727
commit c660582
Showing
6 changed files
with
2,399 additions
and
3,490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
LICENSE | ||
.babelrc | ||
.eslintignore | ||
.eslintrc.json | ||
.gitignore | ||
.npmignore | ||
commitlint.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copied from https://github.com/BretFisher/node-docker-good-defaults/blob/master/Dockerfile | ||
|
||
FROM node:8.9.4 | ||
|
||
# Create app directory | ||
RUN mkdir -p /edx/app | ||
|
||
ARG NODE_ENV=production | ||
ENV NODE_ENV $NODE_ENV | ||
|
||
ARG PORT=80 | ||
ENV PORT $PORT | ||
EXPOSE $PORT 1991 | ||
|
||
WORKDIR /edx | ||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
|
||
# If you are building your code for production | ||
# RUN npm install --only=production | ||
RUN npm install | ||
ENV PATH /edx/app/node_modules/.bin:$PATH | ||
|
||
WORKDIR /edx/app | ||
COPY . /edx/app | ||
|
||
CMD [ "npm", "run", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
shell: ## run a shell on the cookie-cutter container | ||
docker exec -it /bin/bash | ||
|
||
build: | ||
docker-compose build | ||
|
||
up: ## bring up cookie-cutter container | ||
docker-compose up | ||
|
||
up-detached: ## bring up cookie-cutter container in detached mode | ||
docker-compose up -d | ||
|
||
logs: ## show logs for cookie-cutter container | ||
docker-compose logs -f | ||
|
||
down: ## stop and remove cookie-cutter container | ||
docker-compose down | ||
|
||
npm-install-%: ## install specified % npm package on the cookie-cutter container | ||
docker exec npm install $* --save-dev | ||
git add package.json | ||
|
||
restart: | ||
make down | ||
make up | ||
|
||
restart-detached: | ||
make down | ||
make up-detached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
version: "2" | ||
services: | ||
web: | ||
build: | ||
context: . | ||
args: | ||
- NODE_ENV=development | ||
volumes: | ||
- .:/edx/app:delegated | ||
- notused:/edx/app/node_modules | ||
ports: | ||
- "1991:1991" | ||
environment: | ||
- NODE_ENV=development | ||
|
||
volumes: | ||
notused: |
Oops, something went wrong.