aki
aki

Reputation: 41

How should I mount the source code to docker containers on using AWS ECS and ECR?

I'm using docker-compose on my local machine for development environment, and use volumes attribute in docker-compose.yml to mount source directory.

docker-compose.yml is like this.

services:
  nginx:
    build:
      context: ./nginx
    volumes:
      - ./project/public:/var/www/html/public
    ports:
      - "80:80"
      - "443:443"

  php-fpm:
    build:
      context: ./php-fpm
    volumes:
      - ./project:/var/www/html
    ports:
      - "9000:9000"

Now I'd like to use AWS ECS and ECR for launching the service.
However, I don't know how to mount the source code to the docker containers.
I'm using Nginx and PHP-FPM containers. Those are the containers I'd like to mount the source code to.

Do I need to write the git clone command in Dockerfile?

Thanks.

Upvotes: 4

Views: 530

Answers (1)

marianogg9
marianogg9

Reputation: 194

In a task definition, you'll need to create a volume and then a mountpoint here

Upvotes: 1

Related Questions