GithubHelp home page GithubHelp logo

Comments (8)

salim-b avatar salim-b commented on June 19, 2024 2

@pranavxc I've submitted #8439, please have a look.

from nocodb.

pranavxc avatar pranavxc commented on June 19, 2024 1

@pranavxc Extracting on the first run is unfavorable in the case of a containerized app since the extraction is repeated on every container restart (unless /usr/src/appEntry lives on persistent storage), which delays startup. And by adding a tar archive in the container image to be extracted at run-time, you actually _in_crease the storage requirements for the app at run-time.

I'm successfully using the above approach with the official Docker image, i.e.

FROM nocodb/nocodb:latest
RUN tar -xzf /usr/src/appEntry/app.tar.gz -C /usr/src/app/ && rm -f /usr/src/appEntry/app.tar.gz
COPY --link --chown=0:0 mystartup.sh /usr/src/appEntry/start.sh

(where mystartup.sh is the customized start-litestream.sh)

so I think it should work in general.

Would you welcome a PR?

Your concerns make sense, I will have a look at the Dockerfile and get back to you. Skipping compressing will increase the overall image size slightly and other than that no issues are there but I will double-check.

from nocodb.

tcurdt avatar tcurdt commented on June 19, 2024 1

Regarding the non-root part, I'm concerned about existing users who have already mounted volumes if they migrate to the version where we're utilizing a non-root user.

One way could be to just allow for easy non-root user usage. That way it's up to the user to migrate - if they want.

But I think with good upgrade instructions it would not be that bad either. In the end it's just a chown - which maybe could even be baked into the Dockerfile. And nocodb is still pre 1.0. In the long run it certainly would be better to run as non-root.

from nocodb.

salim-b avatar salim-b commented on June 19, 2024

TBH I am not quite sure why an un-tar would be necessary at container startup at runtime over build time.

It is not. Simply removing the untar (also from the other start scripts)

if [ ! -f "$FILE" ]
then
tar -xzf /usr/src/appEntry/app.tar.gz -C /usr/src/app/
fi

and adding the following line to the Dockerfile at this position should suffice.

RUN tar -xzf /usr/src/appEntry/app.tar.gz -C /usr/src/app/ && rm -f /usr/src/appEntry/app.tar.gz

I wonder what @pranavxc thinks.

from nocodb.

pranavxc avatar pranavxc commented on June 19, 2024

TBH I am not quite sure why an un-tar would be necessary at container startup at runtime over build time.

It is not. Simply removing the untar (also from the other start scripts)

if [ ! -f "$FILE" ]
then
tar -xzf /usr/src/appEntry/app.tar.gz -C /usr/src/app/
fi

and adding the following line to the Dockerfile at this position should suffice.

RUN tar -xzf /usr/src/appEntry/app.tar.gz -C /usr/src/app/ && rm -f /usr/src/appEntry/app.tar.gz

I wonder what @pranavxc thinks.

We are keeping our build as a compressed tar file to reduce the overall size, on the first run we are extracting the build and then proceeding. We will check how we can make it support read-only and non-root options.

from nocodb.

salim-b avatar salim-b commented on June 19, 2024

@pranavxc Extracting on the first run is unfavorable in the case of a containerized app since the extraction is repeated on every container restart (unless /usr/src/appEntry lives on persistent storage), which delays startup. And by adding a tar archive in the container image to be extracted at run-time, you actually increase the storage requirements for the app at run-time.

I'm successfully using the above approach with the official Docker image, i.e.

FROM nocodb/nocodb:latest
RUN tar -xzf /usr/src/appEntry/app.tar.gz -C /usr/src/app/ && rm -f /usr/src/appEntry/app.tar.gz
COPY --link --chown=0:0 mystartup.sh /usr/src/appEntry/start.sh

(where mystartup.sh is the customized start-litestream.sh)

so I think it should work in general.

Would you welcome a PR?

from nocodb.

pranavxc avatar pranavxc commented on June 19, 2024

@salim-b: I've reviewed it, and I suggest removing the compression part entirely from the Dockerfile and keeping the build in the extracted state. If you're interested in collaborating on this, please let me know, or I can handle this aspect. Regarding the non-root part, I'm concerned about existing users who have already mounted volumes if they migrate to the version where we're utilizing a non-root user.

from nocodb.

dstala avatar dstala commented on June 19, 2024

Please reopen this thread if you need further assistance

from nocodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.