How to set folder permissions for a particular container on Elastic Beanstalk

terreb

I have troubles setting permissions for a web folder on Elastic Beanstalk. I run multiple containers using custom docker images in one instance: apache-php, mysql, memcached, etc.. For the container "apache-php" I map a folder with my yii2 application to /var/www/html/.

When I manually make a bundle and do upload / deploy via Elastic Beanstalk console I sure have right permissions for the folder and everything works fine.

Now, when I deploy the app using "eb deploy", it drops all permissions and I get a server error and "The directory is not writable by the Web process: /var/www/html/backend/web/assets" in logs.

I can connect via ssh and set necessary permissions manually, but sure this is not convenient, since needs to be done every time I re-deploy the app.

So, my questions is what is the best way to automatically set permission for particular folder in particular container on Elastic Beanstalk?

Perhaps, I can use .ebextensions, but I didn't find how to run "container_commands" for particular container.

Tony Chiboucas

AWS EB Deployment starts your app in /var/app/ondeck

  1. When deploying elastic beanstalk, your app is first unzipped into /var/app/ondeck/
    • Most likely, your local folder being deployed does not have the permissions you want on them.
  2. If you need to make adjustments to your app, or the shell, during deployment, .ebextensions/*.config is the right place to do it.

Container commands should be run to that path

But keep in mind, that these commands will run EVERY time you deploy, whether needed or not, unless you use some method to test for pre-config.

container_commands:
  08user_config:
    test: test ! -f  /opt/elasticbeanstalk/.preconfig-complete
    command: |
      echo "jail-me" > /home/ec2-user/.userfile
  09writable_dirs:
    command: |
       chmod -R 770 /var/app/ondeck/backend/web/assets
       chmod -R 770 /var/app/ondeck/[path]
  99complete:
    command: |
      touch /opt/elasticbeanstalk/.preconfig-complete

files:
  "/etc/profile.d/myalias.sh":
    mode: "000644"
    owner: root
    group: root
    content: |
      alias webroot='cd /var/www/html/backend/web; ls -al --color;'
      echo " ========== "
      echo " The whole point of Elastic Beanstalk is that you shouldn't need to SSH into the server. "
      echo " ========== "

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How To Set Folder Permissions in Elastic Beanstalk Using YAML File?

From Dev

How can I set a per-instance env variable for an elastic beanstalk docker container?

From Dev

How to set the instance type with Elastic Beanstalk?

From Dev

Elastic Beanstalk IAM developer permissions

From Java

How to choose between Elastic Container Service (ECS) or Elastic Container Registry (ECR), Elastic Beanstalk, and Lambda?

From Dev

In elastic beanstalk, how do I run a command before the container is launched?

From Dev

Inno Setup - How to set permissions of installation folder

From Dev

How to set the future permissions of content in folder

From Dev

Replacing a particular instance on AWS Elastic BeanStalk?

From Dev

Laravel and AWS Elastic Beanstalk - File Permissions

From Dev

How do I set the instance count of a Elastic Beanstalk environment to 0?

From Dev

How do I set the instance count of a Elastic Beanstalk environment to 0?

From Dev

PowerShell To Set Folder Permissions

From Java

How do I change file permissions on /tmp during and elastic beanstalk app deploy?

From Dev

AWS Elastic Beanstalk - changing owner of webapp folder

From Dev

Creation of .ebextensions folder in aws elastic beanstalk

From Dev

Elastic Beanstalk Django Deployment With Preconfigured Docker Container

From Dev

Deploying Perl Docker Container to Elastic Beanstalk

From Dev

How to deploy Rails application on Amazon Elastic Beanstalk on a single container Docker environment

From Dev

How to Share AWS EC2 Instances with Elastic Beanstalk Multi-Container Environments

From Dev

How to configure Elastic Beanstalk for RDS

From Dev

how to disable sqs on elastic beanstalk

From Dev

how to disable sqs on elastic beanstalk

From Dev

How to pause charging for Elastic Beanstalk?

From Dev

How do I set permissions on a network-shared folder?

From Dev

WinSCP .NET assembly - How to set folder permissions after creating directory?

From Dev

How do I set permissions on a network-shared folder?

From Dev

How do I set permissions on directory(folder) on IIS 6.0?

From Dev

How do you list the folder permissions of only certain directories that follow a common pattern in a particular directory?

Related Related

  1. 1

    How To Set Folder Permissions in Elastic Beanstalk Using YAML File?

  2. 2

    How can I set a per-instance env variable for an elastic beanstalk docker container?

  3. 3

    How to set the instance type with Elastic Beanstalk?

  4. 4

    Elastic Beanstalk IAM developer permissions

  5. 5

    How to choose between Elastic Container Service (ECS) or Elastic Container Registry (ECR), Elastic Beanstalk, and Lambda?

  6. 6

    In elastic beanstalk, how do I run a command before the container is launched?

  7. 7

    Inno Setup - How to set permissions of installation folder

  8. 8

    How to set the future permissions of content in folder

  9. 9

    Replacing a particular instance on AWS Elastic BeanStalk?

  10. 10

    Laravel and AWS Elastic Beanstalk - File Permissions

  11. 11

    How do I set the instance count of a Elastic Beanstalk environment to 0?

  12. 12

    How do I set the instance count of a Elastic Beanstalk environment to 0?

  13. 13

    PowerShell To Set Folder Permissions

  14. 14

    How do I change file permissions on /tmp during and elastic beanstalk app deploy?

  15. 15

    AWS Elastic Beanstalk - changing owner of webapp folder

  16. 16

    Creation of .ebextensions folder in aws elastic beanstalk

  17. 17

    Elastic Beanstalk Django Deployment With Preconfigured Docker Container

  18. 18

    Deploying Perl Docker Container to Elastic Beanstalk

  19. 19

    How to deploy Rails application on Amazon Elastic Beanstalk on a single container Docker environment

  20. 20

    How to Share AWS EC2 Instances with Elastic Beanstalk Multi-Container Environments

  21. 21

    How to configure Elastic Beanstalk for RDS

  22. 22

    how to disable sqs on elastic beanstalk

  23. 23

    how to disable sqs on elastic beanstalk

  24. 24

    How to pause charging for Elastic Beanstalk?

  25. 25

    How do I set permissions on a network-shared folder?

  26. 26

    WinSCP .NET assembly - How to set folder permissions after creating directory?

  27. 27

    How do I set permissions on a network-shared folder?

  28. 28

    How do I set permissions on directory(folder) on IIS 6.0?

  29. 29

    How do you list the folder permissions of only certain directories that follow a common pattern in a particular directory?

HotTag

Archive