cancel
Showing results for 
Search instead for 
Did you mean: 

trying to create folder in docker alresco docker tomcat webapps folder

brieweb
Champ on-the-rise
Champ on-the-rise

I am trying the tutorial.  I can't seem to create a folder in the Docker image, by default. I seem to recall at some point that I figured out a way to create the folder, but then the tomcat wouldn't recognize my-js-app in the folder. Is there a way to run this externally? It seems that the Docker image has been created differently since this tutorial was written?

 

I connected to the docker repository that runs the tomcat, yet I can not create a folder since the user that it gives me is alfresco and the webapps folder is only writable by root. Any tips on this? 

4ca640e2477c alfresco/alfresco-content-repository-community:25.2.0 "catalina.sh run -se…"
sudo docker exec -i -t 4ca640e2477c /bin/bash
[alfresco@4ca640e2477c tomcat]$ ls -lhd webapps/
drwxr-x---. 1 root Alfresco 4.0K Jul 16 08:37 webapps/
[alfresco@4ca640e2477c tomcat]$ id
uid=33000(alfresco) gid=33000(alfresco) groups=33000(alfresco),1000(Alfresco)

 

8 REPLIES 8

roberto_gamiz
Star Collaborator
Star Collaborator

Hi,

Perhaps you could add a new volume to your docker-compose.yml with the application directory or create your own custom image of the Alfresco content repository, including a copy of your application in a Dockerfile.

However, this tutorial is outdated, and I'm not sure if it will be useful in a real-world environment. It might be better to deploy your application in a new container and configure CORS if necessary.

Regards.




 Roberto Gámiz Sánchez

Alfresco Content Services Engineer



Hmm, I am new to alfresco and I am not sure the steps I would take. Is there a step by step tutorial on creating an application in a new container and configuring CORS? I launched the acs-deployment image in my attempt to make this work.

Hello,

Assuming you are has followed the instruccions of tutotial tu generate the application and you have it in a folder call my-js-app, if you use community-compose.yaml I attach to the post instead the one from acs-deployment  you get the application deployed to the alfresco container (http://localhost:8080/my-js-app) and in a new container (http://localhost:8280).

In the alfresco container is configured cors filter

        -Dcors.enabled=true
        -Dcors.allowed.origins=http://localhost:8280
        -Dcors.allowed.methods=DELETE,GET,HEAD,OPTIONS,POST,PUT
        -Dcors.allowed.headers=Accept,Access-Control-Request-Headers,Access-Control-Request-Method,Authorization,Cache-Control,Content-Type,Origin,X-CSRF-Token,X-Requested-With
        -Dcors.exposed.headers=Access-Control-Allow-Origin,Access-Control-Allow-Credentials,Set-Cookie
and the application is uploaded using a external volumen.
- ./my-js-app:/usr/local/tomcat/webapps/my-js-app
 
A new container is created too
  my-js-app:
    image: nginx:latest
    mem_limit: 128m
    ports:
      - "8280:80"
    volumes:
      - ./my-js-app:/usr/share/nginx/html

Regards

 




 Roberto Gámiz Sánchez

Alfresco Content Services Engineer



Hola Roberto,

Thank you for providing the changes to the `community-compose.yaml`. I applied the updates, yet I get an error when I try to bring it up with docker. Any clues here? I am not very familiar with Docker, so I am guessing that it could be something with the indentation? I am going to have to research how to write the yaml file. I also tried a direct copy and paste of your contents and it said the same error on line 16. 

brian:~/pkg/alfresco/acs-deployment/docker-compose$ sudo docker-compose -f community-compose.yaml up
yaml: line 41: could not find expected ':'

brieweb
Champ on-the-rise
Champ on-the-rise

I opened the configuration file in emacs and it showed the formatting issues. Docker file seems to be working now!

But, when I try to access `my-js-app` it gives an error. Is there some permissions that I need to configure?

http://localhost:8080/my-js-app/ 

Gives the error 

HTTP Status 403 – Forbidden

And, if I try to go into the image, I can't do a directory listing on the folder.

sudo docker container ls

c1136ba380f9 alfresco/alfresco-content-repository-community:25.2.0 "catalina.sh run -se…"

sudo docker exec -i -t c1136ba380f9 /bin/bash

[alfresco@c1136ba380f9 my-js-app]$ pwd
/usr/local/tomcat/webapps/my-js-app

[alfresco@c1136ba380f9 my-js-app]$ ls
ls: cannot open directory '.': Permission denied

brieweb
Champ on-the-rise
Champ on-the-rise

My apologies, yet I am trying to get my head wrapped around the different pieces. I redid the community-compose.yaml and now I made sure to use the latest that matches the HEAD on the acs-deployment repository. I did the docker up and the images (correct term?) started. I then searched for the newly added nginx image and then I connected to it. I attempted to cd into the /usr/share/nginx/html folder and it says permission denied. When I started this whole thing, I created a folder my-js-app with a simple index.html in it. That folder should be mapped into the nginx image?
4ff3df4fdce1 nginx:latest

$ sudo docker exec -i -t 4ff3df4fdce1 /bin/bash

root@4ff3df4fdce1:/# cd /usr/share/nginx/html/
root@4ff3df4fdce1:/usr/share/nginx/html# ls
ls: cannot open directory '.': Permission denied

And now I try to access the url http://localhost:8280/ and I get 403 error, forbidden. 

 

brieweb
Champ on-the-rise
Champ on-the-rise

I just configured a standalone nginx image and I turned off selinux to make it work. I will check that in a bit! I am on Fedora 43.

brieweb
Champ on-the-rise
Champ on-the-rise

Success! I got the my-js-app to work via the link http://localhost:8280/ ! The current workaround is to turn off selinux. This is on a developer laptop, so no big worries. I will have to figure the details on selinux. 

my-js-app-1 | 172.18.0.1 - - [08/Dec/2025:04:47:36 ] "GET / HTTP/1.1" 200 580 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0" "-"
proxy-1 | 172.18.0.1 - - [08/Dec/2025:04:47:36 ] "OPTIONS /alfresco/api/-default-/public/authentication/versions/1/tickets HTTP/1.1" 200 0 "-" "-" 3 "alfresco@docker" "http://172.18.0.7:8080" 17ms
proxy-1 | 172.18.0.1 - - [08/Dec/2025:04:47:36 ] "POST /alfresco/api/-default-/public/authentication/versions/1/tickets HTTP/1.1" 201 83 "-" "-" 4 "alfresco@docker" "http://172.18.0.7:8080" 141ms
alfresco-1 | 2025-12-08T04:47:42,862 [] INFO [alfresco.repo.admin] [http-nio-8080-exec-5] Using database URL 'jdbc:postgresql://postgres:5432/alfresco' with user 'alfresco'.
alfresco-1 | 2025-12-08T04:47:42,862 [] INFO [alfresco.repo.admin] [http-nio-8080-exec-5] Connected to database PostgreSQL version 16.5 (Debian 16.5-1.pgdg120+1)
alfresco-1 | 2025-12-08T04:47:42,862 [] INFO [api.probes.ProbeEntityResource] [http-nio-8080-exec-5] readyProbe: Success - Tested