Docker refactoring #3018
Merged
konrad
merged 6 commits from vlasov-y/frontend:main
into main
2 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'vlasov-y/frontend:main'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Hi! ✋
Your product looks awesome and I have decided to spawn an instance for myself. I have written a Helm chart and tried to deploy your application.
I has failed because of wrong Dockerfile architecture. You run Nginx as non-root user, but do not override cache paths so that it fails to make chown for /var/cache/nginx/*.
First, I have started building crutches using init containers, but then thought that maybe I can participate in open-source and share my experience. I have refactored your frontend. Also I plan to review your backend as well. Then I will add flexible Helm charts for both, if you do not mind :)
Changelog
VIKUNJA_LOG_FORMAT
env var during the runtime. (check other env variables in the Dockerfile)Hi vlasov-y!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://3018-main--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
Nice work!
The docs need adjustment: https://vikunja.io/docs/install-frontend/#docker
# installs usermod and groupmod
shadow
ENV VIKUNJA_HTTP_PORT 8080
ENV VIKUNJA_HTTP2_PORT 8081
Do we even need to let users change these ports? Isn't it enough to choose a different "outer" port when running and publishing the container?
Depends... Maybe someone will want to run the container in host network. If you want, I can just hardcode to 8080 and 8081.
CMD "/run.sh"
COPY scripts/docker/injector.sh /docker-entrypoint.d/50-injector.sh
COPY scripts/docker/nginx.conf /etc/nginx/nginx.conf
COPY scripts/docker/templates/. /etc/nginx/templates/
Can we move this from
scripts/docker
to justdocker
? Since this now also contains config file I think it's more than just scripts.Sure! Usually, I create folder
.devops
. I will move files to folder named docker, as you asked.I built this container locally but it looks like it does not work:
(running as
docker run -p 8888:80 vikunja/frontend:dev
)@konrad You have published the wrong port. Container listens 8080 inside, not 80. Use this one.
Can we change this so that it listens on port 80 by default? I know that's not as straightforward as your solution but it does this by default and changing the port will break a lot of existing settings. It's easy to fix but I fear most people won't read the changelog and then complain in issues and the forum how their setup broke.
Okay so I just started this with
VIKUNJA_HTTP_PORT=80
and it just worked. Please change the default value for the env variable, that should be enough to not break people's setup.server_tokens off;
types_hash_max_size 2048;
types_hash_bucket_size 64;
client_max_body_size 500M;
This seems unnecessary as the frontend does not handle any file uploads. I don't know if it would hurt to leave it in there, though.
It is just a part of template I use everywhere. I agree, this should be removed.
fixed
image/svg+xml
image/x-icon
audio/wav;
gzip_disable "MSIE [1-6]\.";
I think we can omit this, we don't support IE at all
Okay
fixed
'"request_method": "$request_method",'
'"request_time": "$request_time",'
'"server_addr": "$server_addr",'
'"server_name": "$server_name",'
I think this can be removed since the server name is always
_
.Okay
fixed
'"upstream_connect_time": "$upstream_connect_time",'
'"upstream_header_time": "$upstream_header_time",'
'"upstream_response_length": "$upstream_response_length",'
'"upstream_response_time": "$upstream_response_time",'
Same for the upstream log messages since they are only used when nginx is used as a proxy?
Yeah, it is also a part of my template :) Will remove as well
fixed
Okay. It works, but I am confused. Nginx works as non-root o_O
done
Thanks!
e4499f44b7
into main 2 months agoI'm not sure how they do it, but this stack exchange answer says it is possible. The nginx container probably did this.
Could you please point me to the documentation repository? I am not quite sure where is it.
The docs are here: https://kolaente.dev/vikunja/api/src/branch/main/docs
I've already adjusted the docs about the puid and gid of the Frontend container.
Reviewers
e4499f44b7
.