Tomact9 container: error copying file to $CATALINA_HOME/conf/Catalina/localhost - dockerfile

I'm attempting to containerize a java webapp. I need to copy myapp.xml to $CATALINA_HOME/conf/Catalina/localhost in the tomcat container.
I came to realize that the localhost folder in this path only gets created by tomcat when it starts.
How do i copy myapp.xml to $CATALINA_HOME/conf/Catalina/localhost using Dockerfile as this directory does not exist at image build time?
I feel stuck. Can you help me please?
I'm trying to utilize the official tomcat image from docker hub.

Related

How I can replace customized /etc/nginx/nginx.conf file, when build Elastic Beanstalk from Docker File

Dear network please take a look on following questions.
ENVIRONMENT:
AWS Elastic Beanstalk (EBS) (Docker running on 64bit Amazon Linux 2/3.4.12)
SITUATION:
I am running AWS EBS from Docker Platform and using Docker File to run the container. After deployment I need to replace nginx.conf file with my updated nginx.conf,
ACTIONS:
Trying to use in DockerFile ADD https://my-scripts.s3.amazonaws.com/nginx.conf /etc/nginx command, but after deployment the file isn't replacing the original file.
RESULT:
Seems the reason is, that nginx installing in container after Docker File process and probably to have custom nginx.conf I need to use on of the aws platform
custom hooks.
QUESTIONS:
Am I in the right direction regarding custom hooks, or there are
better ways to solve it?
How platform custom hooks could be used for this case to build EBS:
Should I just add hooks /opt/elasticbeanstalk/hooks/postdeploy
EX: ADD s3://my_custom_hook_script /opt/elasticbeanstalk/hooks/postdeploy.?
As a solution just make war/zip archive with DockerFile and .platform/nginx/nginx.conf and deploy war/zip instead of DockerFile only. That replaced /etc/nginx/nginx.conf and not need to restart nginx. COuld be this meaningfull solution ?
NOTE:
When I was building AWS EBS from war file for my other service, I just added the .platform/nginx/nginx.conf under the root of project and after building war keep that folder in the same level as the generated project jar, which replace with custom nginx.conf without restarting nginx service.
Thanks in advance

Copy PHP application from Jenkins to /var/www/html

I have installed Jenkins and Apache to one instance of CentOS in aws. I have connected Jenkins with github but I am not able to access the application through url as it shows the following error.
You should add your website content to the directory /var/www/html/.
I need to copy files from jenkins directory to the mentioned one can you please help me how to copy app so that I can use it on browser.

How to protect my .pyc files wont get extract out from docker

We have built the Django application dockerized till now there was no issue since we were hosting solution for a client, but now we also need to support in-house deployment which means my docker will be installed at the client machine. I see from the root access I can copy the files inside the docker. How we can save the copy issue from inside docker.
How to add such security in my docker? Please suggest.

Nexus 3.5.1 proxies from snapshot repo nothing but maven metadata files

I have upgraded nexus repository from 2.x to 3.x through following path:
2.4.14 -> 3.4.0 -> 3.5.1
All nexus services were packed in docker with data directory mapped from host's. For all services I use default either sonatype/nexus or sonatype/nexus3 containers. Nexus web interface is hidden behind nginx with simple reverse proxying.
I use the nexus service with boot-cj (with no credentials) tools which manages dependencies the same way as maven. Anyway the tool first downloads nexus-maven.xml with relevant sha1 files and tries to download jars. It works fine with all 2.x I had.
I created a proxy repository against remote sonatype-snapshots repo. When I start compilation I have Could not find artifact error. I found that the meatdata files are cached but all poms and jars.
I have tried to fix it by cleaning cache with the clean_cache file trick and more rough rm -rfv /srv/nexus3/nexus-data/cache/* with no success. There are no any logs about error. Also I have checked manually that required artefact exists in the remote repository. More obvious Rebuild index button gave no solution. I do not thing it is a problem with nginx, but who knows? Also leaving overnight to run the scheduled tasks did not help.
The expected artifact is org.eclipse.rdf4j:rdf4j:pom:2.3-20170901.145510-11.

Deploy Django app with Docker

I'm attempting to deploy a Django app via docker, first locally, and then to a cloud server. I could not find an answer to my initial question before I attempt this: if I run docker-machine create, I'm guessing this should be run from within my virtualenv, right?
This would then grab all of my specific app dependencies, and begin to build certificates to throw in the container? If not, please explain otherwise..
Yes you are correct.
I will try to help you by my experience, if you wanna deploy django apps via docker.
First you need to setup docker machine in your local machine. Please see the
instruction. By default driver that will be used is --driver
virtualbox default.
List what kind of specifics dependencies images of your apps. Ex:
you need nginx, postgres, uwsgi, or you need to fetch an image then
modified that image you can use dockerfile (its the best practice
for you).
I suggested you to use docker-compose. Really its make our project
pretty easy to manage. You have to define all images that you need
for your app in docker-compose file Please read this reference.
After you finished develop your app then you want to deploy in production server (cloud) you just need to copy all your project then running your docker-compose. All images dependencies will be automatically pulled in the cloud.
As a reference, you can see this project (this is an open source project that I developed.) On that project, I use make file to manage docker-compose command and it make easy to manage.
An example of dockerfile
An example of docker-compose.yml
An example of Makefile
Hope this will help you.