Skip to content
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

App logo should not disappear on system upgrade #564

Closed
kristoferlund opened this issue Aug 24, 2022 · 12 comments · Fixed by #604
Closed

App logo should not disappear on system upgrade #564

kristoferlund opened this issue Aug 24, 2022 · 12 comments · Fixed by #604
Assignees
Labels
bug Something isn't working

Comments

@kristoferlund
Copy link
Member

Uploaded files need to be stored outside of the Docker container so that the persist over version upgrades.

@kristoferlund kristoferlund added the bug Something isn't working label Aug 24, 2022
@kkatusic
Copy link
Collaborator

As I can see Logo has been saved in database, settings table. If you run bash upgrade.sh it disappear from uploads directory? Am I wright @kristoferlund ? How I can produce that bug?

@kristoferlund
Copy link
Member Author

Yeah.. sort of. :) But, upgrade script only upgrades if there are new docker images to be fetched from GitHub. I'll find the code location of the problem.

@kristoferlund
Copy link
Member Author

This folder is the upload folder:

https://github.com/commons-stack/praise/tree/main/packages/api/uploads

It gets copied into the Docker container when that is built. Then, uploaded files are being served by the Express API server.

https://github.com/commons-stack/praise/blob/7ffe7b24677f9a4a1a79e978304c925993fcdfb8/packages/api/src/server.ts#L85

The upload folder cannot be indside the Docker container but should be outside of it. The api Dockerfile needs to be configured to make that happen.

https://github.com/commons-stack/praise/blob/main/packages/api/Dockerfile

Or.. perhaps it is configured in the docker-compose file.

https://github.com/commons-stack/praise/blob/main/docker-compose.production.yml

@kkatusic
Copy link
Collaborator

I found where it has been stored, and figured it out after I ask you. I checked the code and what I can understand for now when the update is done it overwrites the folder "inside" API container with default files and it serves image that doesn't exist.

Maybe we can omit that folder from the update, better to say omit it from docker-compose, put it in its volume, found one answer that is related to this: https://stackoverflow.com/a/38601156/917827 .

@kristoferlund
Copy link
Member Author

I think we need to configure a docker volume outside of the container. I think that can be setup from within the docker-compose file.

@kkatusic
Copy link
Collaborator

kkatusic commented Sep 1, 2022

Yes it can, you can define volumes inside docker-compose yaml file.

@kkatusic
Copy link
Collaborator

@kristoferlund please check fix/api_uplo

@kkatusic
Copy link
Collaborator

As I said this morning I tried to run images in my local Docker containers but problem exist with FrontEnd image. It has been using same port as my local apache server, but I also tried to run that image with custom ports:

docker-container

but getting a new error: 2022/09/21 18:53:55.572 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"} run: adapting config using caddyfile: /etc/caddy/Caddyfile:2: unrecognized global option: handle

@kristoferlund I will wait your try.

@kkatusic
Copy link
Collaborator

@kristoferlund did you test this?

@kristoferlund kristoferlund mentioned this issue Sep 27, 2022
@kristoferlund
Copy link
Member Author

Yup, it worked but I had to add some small things. Have a look at #604

@kkatusic
Copy link
Collaborator

Yup, it worked but I had to add some small things. Have a look at #604

You changed several files :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants