Running rocket.chat on docker composer. Where are source codes? - meteor

This is probably a stupid question but I am running rocket.chat deployed w/ docker compose. I'm trying to customize the app but I don't know where to access the source codes. I don't really have full grasp of what docker is. Their docs are too confusing for me to understand. Any help? Can anyone direct me to the right direction?

Usually the files are stored on a folder that is specified in the Dockerfile. In the case of Rocket.Chat, this is the /app folder, inside the container.
I strongly suggest you do not edit source files directly inside your docker container. Rocket.Chat files inside a container are a compiled version and not the original source files.
If you still need access to that container files, you can access your container by running:
docker exec -it _your_container_name_ /bin/sh

Related

How do you persist the installation on a Magento Docker container?

I am busy setting up a dockerized environment to develop PHP for Magento.
The image I am using is the following: alexcheng/magento2.
The git repository for this does contain an install script.
When I run "docker-compose up -d" everything works fine but I have to install Magento afresh each time the container goes down.
Any advice for how to deal with this? I am a relative newb at using docker but I can't imagine that you would have to reinstall it each time.
Note, I don't think this has to do with data persistence as a volume has been provisioned. When I include a line in the Dockerfile "RUN install-magento" I get the following error when building:
/usr/bin/env: ‘bash\r’: No such file or directory
The command '/bin/sh -c install-magento' returned a non-zero code: 127
Any guidance would be appreciated. Thank you.
I'm newbie about Docker as you. I suggest that you learn docker before wildly uses docker-compose tool. When we need data persistence the way is to use docker volumes.
Check if your docker-compose.yml have a volume section and if your user have permission on that path.

ASP.NET with Linux Docker autogenerated "Service 'failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder"

Many people asking about problem with
Service 'web' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder
This problem exist, when you trying to build Docker image from autogenerated Dockerfile for Linux in Visual Studio. I resolved that. Because many questions are not connected with ASP.NET directly i will help you, and tell what to do in this case in answer.
I tried to change:
COPY ["Divorcer/Divorcer.csproj", "Divorcer/"] to:
COPY ["/Divorcer/Divorcer.csproj", "Divorcer/"],
COPY ["./Divorcer/Divorcer.csproj", "Divorcer/"],
even to
COPY ["~/.Divorcer/Divorcer.csproj", "Divorcer/"]
Problem still exist.
So, as i told you Randomly generated path is like above.
Solution is in Solution. When you creating new project named "Divorcer" VStudio making
Solution
-- Project
Directories. This problem was resolved with simply bash commands (if you using screen OS you can do it with your mouse).
cd /Path/To/Solution/Project
mv Dockerfile ../
Its simply coping Dockerfile to Solution directory from Project directory. Now you can use docker build -t "someproject" . and it working.
Make sure that you are in Solution directory! Have fun.

How do I give my app directory the correct permissions in order to run docker-compose up?

I am very new to Docker Images. I have therefore been following a tutorial about how to run Docker Image for Meteor Apps. It seems like I managed to install the Base Docker Image for Meteor Apps from https://hub.docker.com/r/geoffreybooth/meteor-base/ which I now am having issues running on my remote server while using the docker-compose up command.
The below is what I get after running docker-compose up:
I thought using sudo docker-compose up might help but I still get the following:
Can someone kindly help point out how to resolve this issue.
Find below my environment details, hopefully you will find them of use in the attempt to help me:
I thought there might be something wrong with my docker installation so I run: sudo docker run hello-world but the message: Hello from Docker!
This message shows that your installation appears to be working correctly.... suggests that the installation is fine.
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
Find below the contents of my folder. Note that the app is the folder containing my app.
$ ls
Dockerfile app docker-compose.yml
The content of Dockerfile is copied and pasted from Dockerfile content:
The content of docker-compose.yml is copied and pasted from docker-compose.yml
also the contents of .dockerignore is copied and pasted from .dockerignore.
Kindly let me know if there is any other environment that I need to expose.
Looking forward to your help.

Docker and Drupal 8 - settings.php

I'm trying to dockerize Drupal 8, and I'm running into this issue that after running Drupal 8 in a container and installing it, if I then remove the container and start it again, it prompts to install it again.
The thing is, when Drupal is installed, a settings.php file is created with the database details.
I wanted to create a systemd unit file for launching the Drupal 8 container in a smart way that even if it's removed, it should start again next time with the same installation.
Someone recommended me to write a systemd unit file with ConditionPathExists= to mount settings.php based on whether it's there locally, however I think this is not going to fully work, because on installation in the container, the generated settings.php file wouldn't be persisted back to the host machine.
So how can I solve the issue of making a Docker container for Drupal that offers to install if it hasn't been installed yet, and from then on use the installed instance even if the container is removed and rebuilt?
I would highly recommend using the official docker image for drupal
https://hub.docker.com/_/drupal/
Saves a lot of time and if you still need to customize your environment at least you can look at its Dockerfile and see how it's been done by the community.
Container persistence
When a container is stopped it can be restarted. All it's files are preserved including any settings.php files that may have been created.
A brand new container, on the other hand, will always start from scratch no simple way to avoid this. To persist data across container instances you need to use volumes.
https://docs.docker.com/engine/userguide/containers/dockervolumes/
Here's how it's done:
#
# Create a data container
#
docker create \
-v /var/www/html/sites \
-v /var/www/private \
--name my-data \
drupal
#
# Run drupal without a db container (select sqlite on first install)
#
docker run --volumes-from my-data --name my-drupal -p 8080:80 -d drupal
Note:
You could use volume mappings to the host machine, but this data container pattern is more flexible, for example when upgrading drupal.
How it works
Drupal 8 is built on top of the offical PHP language image.
Drupal 8.1 Dockerfile
Php 7 Apache Dockerfile
In the PHP buildfile note how Apache is being run in the foreground?
CMD ["apache2-foreground"]
No need for systemd running inside the container.

Docker: how to manage development and production settings?

I'm just getting started with Docker. With the official NGINX image on my OSX development machine (with Docker Machine as the Docker host) I ran up against the bug with sendfile and VirtualBox which means the server fails to show changes I make to files.
The workaround for this is to use a modified nginx.conf file that turns off sendfile. This guy's solution has an instruction in the Dockerfile to copy a customised conf file into the container. Alternatively, this guy maps the NGINX configuration to a new folder with modified conf file.
This kind of thing works OK locally. But what if I don't need this modification on my cloud host? How should I handle this and other differences when it comes to deployment?
You could mount your custom nginx.conf into the container in development via e.g. --volume ./nginx/nginx.conf:/etc/nginx/nginx.conf and simply omit this parameter to docker run in production.
If using docker-compose, the two options I would recommend are:
Employ the limited support for environment variable interpolation and add something like the following under volumes in your container definition: ./nginx/nginx.${APP_ENV}.conf:/etc/nginx/nginx.conf
Use a separate YAML file for production overrides.

Resources