Coder Social home page Coder Social logo

bretfisher / nodejs-rocks-in-docker Goto Github PK

View Code? Open in Web Editor NEW
482.0 21.0 95.0 17.57 MB

DockerCon "Docker for Node.js" examples

Dockerfile 58.87% JavaScript 25.77% CSS 0.82% Handlebars 2.70% Shell 11.83%
docker dockercon nodejs containers node node-module dockerfile docker-compose

nodejs-rocks-in-docker's People

Contributors

bretfisher avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodejs-rocks-in-docker's Issues

Patterns for npm watch?

Thank you so much for this write up of your talk. It has been immensely helpful!

Do you have any patterns or suggestions for using npm watch (or other techniques) for local development in Docker on typescript projects? Anything you can share here that meshes well with the your multi-stage approach would be greatly appreciated.

Thanks again!

Using invalid option

Hi!

You are using an invalid option with npm ci here:

RUN npm install --only=development && npm cache clean --force

Which produces

npm WARN invalid config only="development" set in command line options
npm WARN invalid config Must be one of: null, prod, production

I think the goal here was to make sure that only the dev dependencies were added thus making sure that the non-dev dependencies were the same in your tests and in the final prod stage. But unfortunately, npm will ignore that option.

Cheers

Julien

docker-compose up errors out

Hi - Thanks for this repo. When cloning the repo locally and attempting to spin it up with this command$ docker-compose -f 2.docker-compose.yml up I get an error.

Should I be doing something before I attempt to docker-compose up the project? Thanks!

Pulling db (postgres:)...
latest: Pulling from library/postgres
27833a3ba0a5: Pull complete
ed00742830a6: Pull complete
dc611c2aceba: Pull complete
a61becab5279: Pull complete
8dcff41e7aea: Pull complete
820bf1bbf0d7: Pull complete
050804429905: Pull complete
782c81275334: Pull complete
bfb4aaa36ad6: Pull complete
9101c497b579: Pull complete
746ef6cad24f: Pull complete
f3d6bb76fd3b: Pull complete
32cf0a104c6f: Pull complete
de900772b4f7: Pull complete
Building node
Step 1/16 : FROM node:12-slim as base
12-slim: Pulling from library/node
27833a3ba0a5: Already exists
63859d5abfc2: Pull complete
ab83d96db0f7: Pull complete
15d8325df615: Pull complete
Digest: sha256:f44ebfa8de2f9e1627850aa4631d921f990f1a102a4d86f630a2945514625c2e
Status: Downloaded newer image for node:12-slim
 ---> 436a4da2dc7e
Step 2/16 : ENV NODE=ENV=production
 ---> Running in 39d50f108c1b
Removing intermediate container 39d50f108c1b
 ---> 3c4fa2c20217
Step 3/16 : ENV TINI_VERSION v0.18.0
 ---> Running in 70842b6f9eaa
Removing intermediate container 70842b6f9eaa
 ---> b1d2bdbb2934
Step 4/16 : ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini

 ---> 9e921aeb5d53
Step 5/16 : RUN chmod +x /tini
 ---> Running in 84374c9004b3
Removing intermediate container 84374c9004b3
 ---> 1538cc4cabd3
Step 6/16 : EXPOSE 3000
 ---> Running in 9a012d536622
Removing intermediate container 9a012d536622
 ---> 0cdda211a378
Step 7/16 : RUN mkdir /app && chown -R node:node /app
 ---> Running in 97f22f488b33
Removing intermediate container 97f22f488b33
 ---> fd4b883e6b0e
Step 8/16 : WORKDIR /app
 ---> Running in ab28e69d6818
Removing intermediate container ab28e69d6818
 ---> 026d206f346d
Step 9/16 : USER node
 ---> Running in 5038d6147b62
Removing intermediate container 5038d6147b62
 ---> 3c444accd4f6
Step 10/16 : COPY --chown=node:node package.json package-lock*.json ./
 ---> db35c547a27b
Step 11/16 : RUN npm ci && npm cache clean --force
 ---> Running in 1b34851dc36f

> [email protected] install /app/node_modules/fsevents
> node install


> [email protected] postinstall /app/node_modules/nodemon
> node bin/postinstall || exit 0

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

added 484 packages in 5.318s
npm WARN using --force I sure hope you know what you are doing.
Removing intermediate container 1b34851dc36f
 ---> cfda38442044

Step 12/16 : FROM base as dev
 ---> cfda38442044
Step 13/16 : ENV NODE_ENV=development
 ---> Running in a028eb821f55
Removing intermediate container a028eb821f55
 ---> 87fd034f458b
Step 14/16 : ENV PATH=/app/node_modules/.bin:$PATH
 ---> Running in e5d4f05ae437
Removing intermediate container e5d4f05ae437
 ---> c6bf0e1791a4
Step 15/16 : RUN npm install --only=development
 ---> Running in 671fbedaab82
audited 2680 packages in 2.631s
found 3 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container 671fbedaab82
 ---> d25adc933c0b
Step 16/16 : CMD ["nodemon", "./bin/www", "--inspect=0.0.0.0:9229"]
 ---> Running in 1399fc934f49
Removing intermediate container 1399fc934f49
 ---> ca0478f1c982

Successfully built ca0478f1c982
Successfully tagged dockercon19_node:latest
WARNING: Image for service node was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating dockercon19_db_1 ... done
Creating dockercon19_node_1 ... error

ERROR: for dockercon19_node_1  Cannot start service node: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"nodemon\": executable file not found in $PATH": unknown

ERROR: for node  Cannot start service node: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"nodemon\": executable file not found in $PATH": unknown
ERROR: Encountered errors while bringing up the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.