latest
ajwsurfer at juno.com
Supported Architectures:
amd64
The purpose of this image is to have an Node image that provides a directory to start the a node application and a npm start command to run as www-data
NODE_DIR /srv/app
PORT_NUMBER 9000
USER www-data
User and group use the $USER variable
mkdir -p /< serviceDirectory >/app
mkdir -p /< serviceDirectory >/compose
chown www-data:www-data /<serviceDirectory>
Place the node app in the /< serviceDirectory >/app directory
docker
docker run --name node-container-name -d -p 80:9000 \
-v /< serviceDirectory >/app:/srv/app/ ajwsurfer/node:latest
docker-compose * Place this file in the `/< serviceDirectory >/compose` directory and name it `docker-compose.yml`
version: '2'
services:
node-container-name:
image: ajwsurfer/node:latest
ports:
- 80:9000
volumes:
- /< serviceDirectory >/app:/srv/app/
restart: always
* Start the container
`cd /< serviceDirectory >/compose`
`docker-compose up -d
* Stop the container
`docker-compose stop`
# Description: Basicly start a node alpine container and run a node script
FROM node:alpine
MAINTAINER Andrew Tomczak [email protected]
ENV NODE_DIR /srv/app
ENV PORT_NUMBER 9000
ENV USER www-data
RUN addgroup $USER && adduser $USER
RUN mkdir -P $NODE_DIR
RUN chown $USER:$USER "$NODE_DIR"
WORKDIR "$NODE_DIR"
EXPOSE $PORT_NUMBER
USER $USER
CMD ["npm", "start"]
Content type
Image
Digest
Size
21.6 MB
Last updated
about 9 years ago
docker pull ajwsurfer/node