瀏覽代碼

Update Dockerfile.

parisminton 8 年之前
父節點
當前提交
8cdfedef03
共有 2 個文件被更改,包括 8 次插入19 次删除
  1. 8 17
      Dockerfile
  2. 0 2
      server/index.js

+ 8 - 17
Dockerfile 查看文件

@@ -1,22 +1,13 @@
1
-FROM ubuntu:16.04
1
+FROM node:6
2 2
 
3
-# Install dependencies
4
-RUN apt-get update --yes && apt-get upgrade --yes
3
+RUN mkdir -p /usr/src/app
4
+WORKDIR /usr/src/app
5
+COPY package.json /usr/src/app/
6
+RUN npm install --production
5 7
 RUN apt-get install git nodejs npm \
6 8
 libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev libpng-dev build-essential g++ \
7 9
 ffmpeg \
8
-redis-server --yes
10
+COPY ./ /usr/src/app/
9 11
 
10
-RUN ln -s `which nodejs` /usr/bin/node
11
-
12
-# Non-privileged user
13
-RUN useradd -m audiogram
14
-USER audiogram
15
-WORKDIR /home/audiogram
16
-
17
-# Clone repo
18
-RUN git clone https://github.com/nypublicradio/audiogram.git
19
-WORKDIR /home/audiogram/audiogram
20
-
21
-# Install dependencies
22
-RUN npm install
12
+EXPOSE 8888
13
+CMD [ "npm", "start" ]

+ 0 - 2
server/index.js 查看文件

@@ -65,11 +65,9 @@ app.get("/status/:id/", status);
65 65
 
66 66
 // Healthcheck
67 67
 app.get("/healthcheck/", function(req, res, next) {
68
-  console.log('hitting the healthcheck');
69 68
   return res.status(200).send('I\'m a happy healthcheck.');
70 69
 });
71 70
 
72
-
73 71
 // Serve background images and themes JSON statically
74 72
 app.use("/settings/", function(req, res, next) {
75 73