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 5,334 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

0 votes
0 answers
+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,020 points
5,912 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,020 points
2,712 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
4,032 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,922 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