diff --git a/README.md b/README.md index a47f161..d0e95c4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# Rubric +* https://review.udacity.com/#!/rubrics/2804/view + + # Docker > Docker Cheat Sheet @@ -75,7 +79,11 @@ docker run --env-file ../env.list --net host udagram-feed * https://knowledge.udacity.com/questions/397631 * https://knowledge.udacity.com/questions/192623 +# AWS +## S3 +* ```aws s3 ls momi-303817241937-dev``` to list the content of given bucket +* ```aws s3 rm s3://momi-303817241937-dev/tea.jpg``` to remove given file --- **NOTE** diff --git a/udagram-feed/Dockerfile b/udagram-feed/Dockerfile index e5d5811..67c2769 100644 --- a/udagram-feed/Dockerfile +++ b/udagram-feed/Dockerfile @@ -14,7 +14,7 @@ RUN npm ci # Bundle app source COPY . . -EXPOSE 8080 +EXPOSE 8085 CMD [ "npm", "run", "prod" ] diff --git a/udagram-feed/src/server.ts b/udagram-feed/src/server.ts index 934dd39..f5f7e13 100644 --- a/udagram-feed/src/server.ts +++ b/udagram-feed/src/server.ts @@ -16,7 +16,7 @@ import {V0_FEED_MODELS} from './controllers/v0/model.index'; await sequelize.sync(); const app = express(); - const port = process.env.PORT || 8080; + const port = process.env.PORT || 8085; app.use(bodyParser.json()); diff --git a/udagram-frontend/Dockerfile b/udagram-frontend/Dockerfile index 8f01795..fac4429 100644 --- a/udagram-frontend/Dockerfile +++ b/udagram-frontend/Dockerfile @@ -1,20 +1,17 @@ -## Build FROM beevelop/ionic:latest AS ionic -# Create app directory WORKDIR /usr/src/app -# Install app dependencies -# A wildcard is used to ensure both package.json AND package-lock.json are copied -# where available (npm@5+) COPY package*.json ./ RUN npm ci -# Bundle app source COPY . . RUN ionic build -## Run FROM nginx:alpine #COPY www /usr/share/nginx/html COPY --from=ionic /usr/src/app/www /usr/share/nginx/html +# __CB__added +#EXPOSE 8100 + +# __CB__added #CMD ["ionic", "serve"] #CMD ["ionic", "serve", "--external"] diff --git a/udagram-reverse-proxy/Dockerfile b/udagram-reverse-proxy/Dockerfile new file mode 100644 index 0000000..998dd66 --- /dev/null +++ b/udagram-reverse-proxy/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:alpine + +COPY nginx.conf /etc/nginx/nginx.conf diff --git a/udagram-reverse-proxy/deploy/deployment.yaml b/udagram-reverse-proxy/deploy/deployment.yaml new file mode 100644 index 0000000..5befe9f --- /dev/null +++ b/udagram-reverse-proxy/deploy/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + labels: + service: reverseproxy + name: reverseproxy +spec: + replicas: 1 + template: + metadata: + labels: + service: reverseproxy + spec: + containers: + - image: finfalter/reverse-proxy + name: reverseproxy + imagePullPolicy: Always + resources: + requests: + memory: "64Mi" + cpu: "250m" + limits: + memory: "1024Mi" + cpu: "500m" + ports: + - containerPort: 8080 + restartPolicy: Always \ No newline at end of file diff --git a/udagram-reverse-proxy/deploy/deployment_apps.yaml b/udagram-reverse-proxy/deploy/deployment_apps.yaml new file mode 100644 index 0000000..dab32f9 --- /dev/null +++ b/udagram-reverse-proxy/deploy/deployment_apps.yaml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: reverseproxy + labels: + app: reverseproxy +spec: + replicas: 1 + selector: + matchLabels: + app: reverseproxy + template: + metadata: + labels: + app: reverseproxy + spec: + containers: + - image: finfalter/reverse-proxy + name: reverseproxy + imagePullPolicy: Always + resources: + requests: + memory: "64Mi" + cpu: "250m" + limits: + memory: "1024Mi" + cpu: "500m" + ports: + - containerPort: 8080 + restartPolicy: Always \ No newline at end of file diff --git a/udagram-reverse-proxy/deploy/service.yaml b/udagram-reverse-proxy/deploy/service.yaml new file mode 100644 index 0000000..e9c0b90 --- /dev/null +++ b/udagram-reverse-proxy/deploy/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + service: reverseproxy + name: reverseproxy-svc +spec: + ports: + - name: "8080" + port: 8080 + targetPort: 8080 + selector: + service: reverseproxy diff --git a/udagram-reverse-proxy/nginx.conf b/udagram-reverse-proxy/nginx.conf new file mode 100644 index 0000000..5048102 --- /dev/null +++ b/udagram-reverse-proxy/nginx.conf @@ -0,0 +1,15 @@ +events { +} +http { + server { + listen 8080; + + location /api/v0/feed { + proxy_pass http://localhost:8085/api/v0/feed/; + } + + location /api/v0/users { + proxy_pass http://localhost:8081/api/v0/users/; + } + } +} diff --git a/udagram-user/Dockerfile b/udagram-user/Dockerfile index 8551d84..4da4bc9 100644 --- a/udagram-user/Dockerfile +++ b/udagram-user/Dockerfile @@ -14,7 +14,7 @@ RUN npm ci # Bundle app source COPY . . -EXPOSE 8080 +EXPOSE 8081 CMD [ "npm", "run", "prod" ]