I am kinda newbie into the world of Docker & I have been playing with Docker & Docker Compose for some time. This is my first time posting on Docker forum, so please ignore if my writing is not professional.
I am using Docker Desktop 4.5.1 (74721) on Windows 10.
I want to push multiple services to dockerhub via Docker Compose, but I cannot find a way how will I push the image(s) to Docker hub.
I am able to run docker-compose up -d locally inside my project folder and it works fine generating three containers.
I want to push the same infrastructure to Docker Hub & AWS ECR, only but i cannot fully understand the mechanism. Below I am sharing my Dockerfile & docker-compose.yml files for your reference.
Kindly guide me in the right direction.
Here’s my Dockerfile:
FROM php:8.0-apache
RUN docker-php-ext-install pdo_mysql
WORKDIR /var/www/html/
RUN php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer
COPY . ./Author-API
WORKDIR /var/www/html/Author-API
RUN composer install
COPY mysites.conf /etc/apache2/sites-available/mysites.conf
RUN a2enmod rewrite &&\
a2dissite 000-default.conf &&\
a2ensite mysites.conf &&\
service apache2 restart
EXPOSE 8085
I never tried to run ecs services using docker-compose. I run plenty of ECS Services and had to use Service Discovery - Amazon Elastic Container Service for service discovery. The dns resolver inside the ECS Tasks (=“docker” container) use the VPC’s default resolver and not the build-in dns resolver docker provides ootb.