-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think v1.3.0
not working with command starts with NODE_ENV=
#296
Comments
NODE_ENV=
v1.3.0
not working with command starts with NODE_ENV=
Hi @ensia96, Here is what I was able to find, hope this helps.
Passing in the However, starting v1.3.0 the Command field is being read and passed on to ECS task definition. Why the command field you passed not be working: Here is ECS documentation explaining how Command is used in ECS: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html. As per the documentation the command field maps to COMMAND parameter on docker run. Below is the relevant paragraph from the documentation:
I tested by trying to pass in a command like you mentioned when running a docker image: Looks like we get a similar error here from docker when trying to run above command:
What might work: To get around this issue, I was able to set the Environment variable in my docker file with something like: And then pass node dist/app.local.js as command to the github workflow.
Let me know if this helps. |
I will reflect your recommendations into my code in next deployment, and then share the result. - name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}
environment-variables: |
environment-variables: |
NODE_ENV=${{ env.ENV }}
# envs
command: node dist/app.local.js Thank you! |
It works! I will close this issue. Thank you for your fast reply! |
Github actions runs well, but on ECS, container exits with error
Error: Cannot find module '/usr/src/app/NODE_ENV=dev'
The code below is the code of my project.
So, I fixed code above to below, and now the container works well.
I saw your update changelog.
And found this
The text was updated successfully, but these errors were encountered: