How do I go from development docker-compose yml to deployed docker-compose yml in AWS

+4 votes

These are my docker-compose.yml commands:

version: '3'
services:
    server:
        build:
            context: ../../
            dockerfile: ./packages/website/Dockerfile
        command: yarn serve
        environment:
            PORT: 3000
            NODE_ENV: production
        restart: always
    nginx:
        build:
            context: ./
            dockerfile: ./nginx/Dockerfile
        command: nginx -c /etc/nginx/nginx.conf -g "daemon off;"
        depends_on:
            - server
        ports:
            - "80:80"
        restart: always





It works here locally but now I want to deploy this to t2.micro or some other paid services but I am not really sure how to do it.

My plan is to create a separate docker-compose.yml file which refers to the images rather than the physical dockerfile(s)
Please just drop in an answer to aware me about this.
Thanks in Advance!

Jun 7, 2018 in AWS by Flying geek
• 3,280 points

edited Jun 7, 2018 by Flying geek 4,861 views

1 answer to this question.

0 votes

It can work if you try to put the entire directory into the cloud while keeping the entire directory structure.

If you just want to upload the docker-compose.yml file into the cloud without anything else, you'd need to modify it by removing the building field and adding an image: xxx field.

Now the question comes up is that "how can I refer to an image in my docker-compose.yml file`.

You can achieve it in two ways:

  1. Build the image and put it in some container registry, it can be DockerHub, or a private one and refer to it with registry-url/image-name:image-tag. In case you're using DockerHub, you can ignore the registry-url/ part.
  2. Build the image and scp to the cloud and refer to it with image-name:image-tag.
answered Jun 7, 2018 by Cloud gunner
• 4,670 points
Read your blog, Excellent informative post on How do I go from development docker-compose.yml to deployed docker-compose.yml in AWS

Related Questions In AWS

+2 votes
2 answers

How do we move a domain from Hostgator to AWS Route 53?

I found this  Before transferring a domain, make ...READ MORE

answered Aug 3, 2018 in AWS by Priyaj
• 58,090 points
5,223 views
0 votes
1 answer

How can i copy tables from one database to other on AWS?

You can use AWS Data pipeline to ...READ MORE

answered Jul 5, 2018 in AWS by Priyaj
• 58,090 points
4,281 views
0 votes
1 answer

How can I do Continuous data ingestion from on prem data sources to redshift

I can Recommend looking into AWS Schema ...READ MORE

answered Aug 8, 2018 in AWS by Priyaj
• 58,090 points
1,542 views
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
2,426 views
+2 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,439 views
+1 vote
2 answers

How do I get my AWS Glue client in JAVA?

Hey, you've been using a correct code ...READ MORE

answered Apr 17, 2018 in AWS by Cloud gunner
• 4,670 points
4,374 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP