copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

support ENTRYPOINT override - allow the use of a single image for multiple workload types

Open camilosantana opened this issue 5 years ago • 3 comments

Scenario

from aws/copilot-cli. @rs-ds says:

Hi Team, I have two services (1 load balanced web service and 1 backend service). Both images are exactly same but each has its own command to run. How can I use the same Dockerfile with different commands for both the service. Or is there any alternative to do this?

In my case, I have a load balanced web service and 1 scheduled job.

The goal here is to avoid building the same image twice. I'm currently working around it by reading environment variable and using a case in bash to launch the desired executable.

Proposal

Allow us to override the ENTRYPOINT in dockerfile with a command field in the copilot manifest to launch a unique process using the same image source.

name: 'fancy-service'
image:
  #  ...
command: ' bundle exec thin -p 3000'
entrypoint: '/app/start.sh'

camilosantana avatar Feb 22 '21 00:02 camilosantana

+1 for adding entrypoint, I'm in the same situation, and i think alot of users are facing the same problem. I'm amazed it's not included yet.

eskobarba avatar Feb 22 '21 11:02 eskobarba

@z00dev thanks. Could you use the emote reaction with a thumbs up to show interest? It's best to leave the comments for contributor discussions since everyone involved gets an email.

camilosantana avatar Feb 22 '21 16:02 camilosantana

This is now released in v1.4.0! https://github.com/aws/copilot-cli/releases/tag/v1.4.0

efekarakus avatar Mar 15 '21 21:03 efekarakus