Преглед на файлове

Merge pull request #14 from ManoMarks/master

Porting to Alpine images
Ben Firshman преди 9 години
родител
ревизия
45f53434db
променени са 7 файла, в които са добавени 15 реда и са изтрити 13 реда
  1. 1 3
      docker-compose.yml
  2. 2 2
      result-app/Dockerfile
  3. 1 1
      result-app/views/index.html
  4. 3 3
      voting-app/Dockerfile
  5. 1 1
      voting-app/app.py
  6. BIN
      voting-app/utils/__init__.pyc
  7. 7 3
      worker/Dockerfile

+ 1 - 3
docker-compose.yml

@@ -34,7 +34,7 @@ services:
       - back-tier
 
   redis:
-    image: redis
+    image: redis:alpine
     ports: ["6379"]
     networks:
       - back-tier
@@ -52,5 +52,3 @@ volumes:
 networks:
   front-tier:
   back-tier:
-
-

+ 2 - 2
result-app/Dockerfile

@@ -1,9 +1,9 @@
-FROM node:0.10
+FROM node:5.11.0-slim
 
-RUN mkdir /app
 WORKDIR /app
 
 ADD package.json /app/package.json
+RUN npm config set registry http://registry.npmjs.org
 RUN npm install && npm ls
 RUN mv /app/node_modules /node_modules
 

+ 1 - 1
result-app/views/index.html

@@ -6,7 +6,7 @@
     <base href="/index.html">
     <meta name = "viewport" content = "width=device-width, initial-scale = 1.0">
     <meta name="keywords" content="docker-compose, docker, stack">
-    <meta name="author" content="Tutum dev team">
+    <meta name="author" content="Docker">
     <link rel='stylesheet' href='/stylesheets/style.css' />
   </head>
   <body ng-controller="statsCtrl" >

+ 3 - 3
voting-app/Dockerfile

@@ -1,5 +1,5 @@
 # Using official python runtime base image
-FROM python:2.7
+FROM python:2.7-alpine
 
 # Set the application directory
 WORKDIR /app
@@ -11,8 +11,8 @@ RUN pip install -r requirements.txt
 # Copy our code from the current folder to /app inside the container
 ADD . /app
 
-# Make port 5000 available for links and/or publish
-EXPOSE 80 
+# Make port 80 available for links and/or publish
+EXPOSE 80
 
 # Define our command to be run when launching the container
 CMD ["python", "app.py"]

+ 1 - 1
voting-app/app.py

@@ -41,4 +41,4 @@ def hello():
 
 
 if __name__ == "__main__":
-	app.run(host='0.0.0.0', port=80, debug=True)
+    app.run(host='0.0.0.0', port=80, debug=True)

BIN
voting-app/utils/__init__.pyc


+ 7 - 3
worker/Dockerfile

@@ -1,6 +1,10 @@
-FROM java:7
+FROM java:openjdk-8-jdk-alpine
 
-RUN apt-get update -qq && apt-get install -y maven && apt-get clean
+RUN MAVEN_VERSION=3.3.3 \
+ && cd /usr/share \
+ && wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz -O - | tar xzf - \
+ && mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \
+ && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
 
 WORKDIR /code
 
@@ -12,4 +16,4 @@ RUN ["mvn", "verify"]
 ADD src /code/src
 RUN ["mvn", "package"]
 
-CMD ["/usr/lib/jvm/java-7-openjdk-amd64/bin/java", "-jar", "target/worker-jar-with-dependencies.jar"]
+CMD ["java", "-jar", "target/worker-jar-with-dependencies.jar"]