Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nitrocode/dockerballs
https://github.com/nitrocode/dockerballs
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nitrocode/dockerballs
- Owner: nitrocode
- Created: 2018-02-09T00:18:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-14T21:18:25.000Z (about 6 years ago)
- Last Synced: 2024-10-27T03:46:38.384Z (about 2 months ago)
- Language: Dockerfile
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dockerize
This is a quick project to whip up a dockerized container for a friend in both `Dockerfile` and `docker-compose.yml`.
The Node.js app starts on port `3000` in the container and is mapped to port `3001` on the host.
## Scripts
In the `scripts/` directory, the following scripts exist:
* `dockerup.sh` - uses `docker-compose.yml` which uses `Dockerfile` to build an image. See `docker-compose.yml.orig` to show how to create a docker container without the `Dockerfile`.
* `dockerbuild.sh` - uses `Dockerfile` to build an image
* `dockerdel.sh` - removes images with the name
* `dockerrun.sh` - runs the docker image in detached mode
* `dockershell.sh` - runs the docker image and executes `bash` inside the shellThe aforementioned scripts should be run in root directory of the repo or the docker files will not be found. See below in the Usage section.
## Usage
### Build
$ ./scripts/dockerup.sh
Recreating docker_node_1 ... done### Hit on Linux
$ curl localhost:3001
BALLS### Hit on OSX
On OSX, I used the [Docker tutorial](https://pilsniak.com/how-to-install-docker-on-mac-os-using-brew/) by Marcin Pilśniak and learned that you cannot use localhost to hit the app. Instead, docker-machine runs docker containers on a separate IP.
Run this command to find the IP
$ docker-machine ip default
192.168.64.2
$ curl localhost:3001
curl: (7) Failed to connect to localhost port 3001: Connection refused
$ curl 192.168.64.2:3001
BALLS## Linting
$ npm i
$ ./node_modules/.bin/dockerlint
INFO: Dockerfile is OK.