0
votes

I get Internal error when I deploy my docker compose file to aws using ecs-cli . In my console I get that the service is up and running as well as in the aws gui but when I try to open the link I get internal error.amazon view link not working

Dockerfile.txt

FROM clojure:openjdk-8-lein

RUN apt update && apt install -y git make python3 && apt clean
WORKDIR /opt
RUN mkdir my-project && cd my-project && git clone https://github.com/ThoughtWorksInc/infra-problem.git && cd infra-problem && make libs && make clean all

docker-compose.yml

version: "3"
services:
  quotes:
    image: selmensh/newsfeeds
    build:
        context: .
        dockerfile: ./Dockerfile.txt
    container_name: quotes
    command: java -jar ./my-project/infra-problem//build/quotes.jar
    environment:
      - APP_PORT=9200
    ports:
      - 9200:9200
  newsfeed:
    image: selmensh/newsfeeds
    build: 
        context: .
        dockerfile: ./Dockerfile.txt
    container_name: newsfeed
    command: java -jar ./my-project/infra-problem/build/newsfeed.jar
    environment:
      - APP_PORT=5000
    ports:
      - 5000:5000
  assets:
    image: selmensh/newsfeeds
    build: 
        context: .
        dockerfile: ./Dockerfile.txt
    container_name: assets
    command: python3 ./my-project/infra-problem/front-end/public/serve.py
    ports:
      - 8000:8080
  front-end:
    image: selmensh/newsfeeds
    build: 
        context: .
        dockerfile: ./Dockerfile.txt
    command: java -jar ./my-project/infra-problem/build/front-end.jar
    environment:
      - APP_PORT=8081
      - STATIC_URL=http://assets:8000
      - QUOTE_SERVICE_URL=http://quotes:9200
      - NEWSFEED_SERVICE_URL=http://newsfeed:5000
      - NEWSFEED_SERVICE_TOKEN=T1&eWbYXNWG1w1^YGKDPxAWJ@^et^&kX
    depends_on:
      - quotes
      - newsfeed
    ports:
      - 80:8081

I also notice that ecs does not support build so I made an image and pushed to docker hub. However I see that this might have some security issues since I clone the code in the docker file. The reason I do this is because the code has a folder called utilities which is common and is required by all the other services. Is there a better approach ?

1
Can you share some code - Arun K

1 Answers

0
votes

It would be great if you could demonstrate more details, it seems a problem in your application, now something I could point you to would be the terraform tool, through it you can better manage your infrastructure (idempotency).