Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#12 #33

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

#12 #33

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion alpine-consul-nginx-nodejs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ MAINTAINER Scott Mebberson <[email protected]>
# Install Node.js, and the latest version of npm (and Python in case any npm modules require building)
RUN apk add --update nodejs git python make && \
rm -rf /var/cache/apk/* && \
npm install -g npm
npm install -g npm && \
addgroup nodejs && \
adduser -g '' -DS -G nodejs -s /bin/sh nodejs
7 changes: 5 additions & 2 deletions alpine-consul-nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM smebberson/alpine-consul-base:2.0.0
MAINTAINER Scott Mebberson <[email protected]>

ENV NODE_VERSION=v4.4.1 NPM_VERSION=3
ENV NODE_VERSION=v4.4.1 \
NPM_VERSION=3

RUN apk add --update git curl make gcc g++ python linux-headers libgcc libstdc++ binutils-gold && \
curl -sSL https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.tar.gz | tar -xz && \
Expand All @@ -14,4 +15,6 @@ RUN apk add --update git curl make gcc g++ python linux-headers libgcc libstdc++
apk del gcc g++ linux-headers libgcc libstdc++ binutils-gold && \
rm -rf /etc/ssl /node-${NODE_VERSION} /usr/include \
/usr/share/man /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp \
/usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html
/usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html && \
addgroup nodejs && \
adduser -g '' -DS -G nodejs -s /bin/sh nodejs
7 changes: 5 additions & 2 deletions alpine-nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM smebberson/alpine-base:1.2.1
MAINTAINER Scott Mebberson <[email protected]>

ENV NODE_VERSION=v5.9.0 NPM_VERSION=3
ENV NODE_VERSION=v5.9.0 \
NPM_VERSION=3

RUN apk add --update git curl make gcc g++ python linux-headers libgcc libstdc++ binutils-gold && \
curl -sSL https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.tar.gz | tar -xz && \
Expand All @@ -14,4 +15,6 @@ RUN apk add --update git curl make gcc g++ python linux-headers libgcc libstdc++
apk del gcc g++ linux-headers libgcc libstdc++ binutils-gold && \
rm -rf /etc/ssl /node-${NODE_VERSION} /usr/include \
/usr/share/man /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp \
/usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html
/usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html && \
addgroup nodejs && \
adduser -g '' -DS -G nodejs -s /bin/sh nodejs
13 changes: 8 additions & 5 deletions examples/user-consul-nginx-nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM smebberson/alpine-consul-nginx-nodejs
MAINTAINER Scott Mebberson <[email protected]>

ENV NODE_ENV=development NODE_PORT=4000
ENV NODE_ENV=development \
NODE_PORT=4000

# Add image source
ADD root /

USER nodejs

# Build the Node.js modules on the container itself
ADD root/app/package.json /app/package.json
RUN cd /app && \
npm install --production

# Add image source
ADD root /
USER root
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

cd /app

exec node server.js;
exec s6-setuidgid nodejs node server.js;

This file was deleted.

This file was deleted.

15 changes: 8 additions & 7 deletions examples/user-consul-nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM smebberson/alpine-consul-nodejs
MAINTAINER Scott Mebberson <[email protected]>

ENV NODE_ENV=development NODE_PORT=4000

# Build the Node.js modules on the container itself
ADD root/app/package.json /tmp/package.json
RUN cd /tmp && npm install --production
ENV NODE_ENV=development \
NODE_PORT=4000

# Add image source
ADD root /

# Replace the node_modules with those built on the image
RUN rm -rf /app/node_modules && cp -r /tmp/node_modules /app/node_modules
USER nodejs

RUN cd /app && \
npm install --production

USER root
2 changes: 1 addition & 1 deletion examples/user-consul-nodejs/root/etc/services.d/app/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

cd /app

exec node server.js;
exec s6-setuidgid nodejs node server.js;
2 changes: 1 addition & 1 deletion examples/user-consul-nodejs/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

# run the user-consul-nodejs image
docker run --rm --name user-consul-nodejs --link user-consul:consul-agent -p 4000:4000 smebberson/user-consul-nodejs
docker run --rm --name user-consul-nodejs -p 4000:4000 smebberson/user-consul-nodejs