-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.dockerfile
30 lines (19 loc) · 1.01 KB
/
node.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Build: docker build -f node.dockerfile -t chalten/nodeapp_api:1.0.0 .
# Create a custom bridge network and add container into it
# docker network create --driver bridge nodeappisolated_network
# NOTE: $(pwd) in the following line is for Mac and Linux. See https://blog.codewithdan.com/docker-volumes-and-print-working-directory-pwd/ for Windows examples.
# docker run -d --net=nodeappisolated_network --name nodeapp_api -p 5000:5000 -v $(pwd)/logs:/var/www/logs chalten/nodeapp_api
# docker run -d --net=nodeappisolated_network --name nodeapp_api -p 5000:5000 -v [pathToYourProject]]/logs:/var/www/logs chalten/nodeapp_api:1.0.3
# Seed the database with sample database
# Run: docker exec nodeapp_api node seeder.js
FROM node:alpine
LABEL author="mate.dev/chris"
ARG PACKAGES=nano
ENV TERM xterm
RUN apk update && apk add $PACKAGES
WORKDIR /var/www
COPY package.json package-lock.json ./
RUN npm install
COPY . ./
EXPOSE $PORT
ENTRYPOINT ["npm", "start"]