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

0 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,160 points

edited Jun 7, 2018 by Flying geek 476 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,280 points

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
• 56,960 points
1,160 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
• 56,960 points
83 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
• 56,960 points
361 views
0 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
• 56,960 points
257 views
0 votes
1 answer
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
248 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,280 points
1,088 views