Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
feature: improved docker integration #1
Browse files Browse the repository at this point in the history
prevent node_modules from being overwritten
updated Readme
added .tmp directory
added development compose file
  • Loading branch information
heyMP committed Sep 27, 2018
1 parent 3333113 commit 055bc50
Show file tree
Hide file tree
Showing 5 changed files with 31 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
.tmp
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,4 @@ $RECYCLE.BIN/
# End of https://www.gitignore.io/api/node,code,linux,macos,windows

package-lock.json
.tmp
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ RUN yarn link
WORKDIR /home/node/html
COPY . .

ENTRYPOINT [ "bash" ]
# Default to a tmp directory for volume mounting
WORKDIR /home/node/tmp

ENTRYPOINT [ "wcfactory" ]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,19 @@ Verify that the cli is installed globally
```bash
wcfactory -h
```

### Docker

We include a docker-compose file for developement purposes which has the monorepo pre-installed. It also has
the cli globally available in the image.

To run wcfactory cli commands inside of the docker image you can run the follow command:

Examples
```bash
docker-compose run wcfactory <command>
docker-compose run wcfactory init
docker-compose run wcfactory new
```

Anything created inside of the docker image will be synced locally inside of the `./tmp/docker/wcfactory` directory.
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3"
services:
wcfactory:
build: .
build: .
volumes:
- .:/home/node/html
- ./.tmp/docker/wcfactory:/home/node/tmp
# Prevent node_module override
- /home/node/html/node_modules
- /home/node/html/packages/cli/node_modules
- /home/node/html/packages/generator-wcfactory/node_modules

0 comments on commit 055bc50

Please sign in to comment.