docker-flask-example

A production ready example Flask app that's using Docker and Docker Compose. (by nickjj)

Docker-flask-example Alternatives

Similar projects and alternatives to docker-flask-example

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better docker-flask-example alternative or higher similarity.

Suggest an alternative to docker-flask-example

Reviews and mentions

Posts with mentions or reviews of docker-flask-example. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-09-09.
  • Is there any project which automatically builds a docker container with a flask application automatically?
    reddit.com/r/flask | 2021-09-09
    If you decide to go with creating your own Dockerfile I put together this example app https://github.com/nickjj/docker-flask-example.
  • using docker + gunicorn for development environment but reload somehow doesn't work
    reddit.com/r/flask | 2021-08-29
    If you're interested, here's a fully working example app that uses Docker along with gunicorn and more. Reloading works with this set up: https://github.com/nickjj/docker-flask-example
  • Need to dockerize a flask application.
    reddit.com/r/docker | 2021-07-25
    But a more up to date Flask example that I have is at https://github.com/nickjj/docker-flask-example.
  • docker-compose creates node_modules folder on host
    reddit.com/r/docker | 2021-07-02
  • A production ready Flask 2.0+ example starter app with Docker Compose / gunicorn / Celery / PostgreSQL / Redis / Webpack / TailwindCSS (JIT compiler enabled)
    reddit.com/r/flask | 2021-05-13
  • Difference between a Django and Flask app in terms of Lines of Code
    reddit.com/r/flask | 2021-04-17
  • I'd like to review your README
    news.ycombinator.com | 2021-04-17
    I think production ready on its own has value because it sets the stage of what to expect.

    There's a very big difference between a project being production ready or not. Production ready (to me at least) means the project has been thoroughly tested on a live site and is in a position where you can take it as is and run it in production with confidence that it's going to work.

    For example I have a Docker + Flask example starter kit project at https://github.com/nickjj/docker-flask-example and the GitHub description is "A production ready example Flask app that's using Docker and Docker Compose.". In this context to me that says it's using multi-stage builds, env variables, deals with static files in a way that's cacheable (md5 hashes, etc.) and overall you can expect to see patterns that work well in both development and production. The README goes over those details too in case you didn't infer them from only "production ready" too.

  • Docker-compose isn’t good for production?
    reddit.com/r/docker | 2021-04-16
  • Suggest a learning Docker project
    reddit.com/r/docker | 2021-04-08
  • TailwindCSS JIT with Arbitrary Values
    news.ycombinator.com | 2021-04-07
    If anyone is looking for practical examples of using Tailwind + the JIT compiler with various web frameworks and Webpack, I have a few example starter projects at:

    - https://github.com/nickjj/docker-flask-example

    - https://github.com/nickjj/docker-django-example

    - https://github.com/nickjj/docker-node-example

  • Show HN: Test your Gitlab CI Pipelines changes locally using Docker
    news.ycombinator.com | 2021-02-23
    IMO this is where having access to native Linux, WSL 2 or a VM along with using Docker helps a lot.

    Personally I write the bulk of my CI scripts as shell scripts and put them into a runnable file included in the project. This way I can run CI scripts locally so I can test the work flow on my machine. It's also handy in case CI is down you can still test and deploy your code. Lastly it lets you easily jump between CI providers since a majority of your logic is in a generic shell script.

    For example in my CI specific files I typically only call `./run ci:install-deps && ./run ci:test`. Then there's a tiny bit of boiler plate in each CI provider's yml file to handle specific things for that provider.

    Since my app is running in Docker most of the heavy duty dependencies are all contained there. The dependencies I install directly in CI end up being things like installing shellcheck and helper scripts for CI (like tiny scripts that let you wait until a process is ready). Having WSL 2 is nice here because these are very small tools that I want locally installed anyways, but if you don't run Ubuntu locally you can do this in a VM.

    A working example of this is here: https://github.com/nickjj/docker-flask-example

    Check out the run script for "ci:" functions and the GH Actions yml file. This same strategy applies to GitLab or any other CI provider too.

  • Any good example projects that I can use to compare my own flask site?
    reddit.com/r/flask | 2021-02-22
    In terms of best practices and tips, this repo https://github.com/nickjj/docker-flask-example has everything I've ever learned using Flask for the last 5-6 years.
  • FastAPI framework, high perf, easy to learn, fast to code, ready for production
    news.ycombinator.com | 2021-02-01
    I still happily use Flask with mostly Jinja rendered templates. With things like Hotwire and htmx you can build very nice feeling apps without going all-in with an API back-end and JS front-end.

    I released https://github.com/nickjj/docker-flask-example as a starter kit for what I use. It wires up things like SQLAlchemy, Celery, Flask, gunicorn, Webpack, etc. with Docker.

  • news.ycombinator.com | 2021-01-24
    > What are the issues with using docker to solve this problem ?

    Docker alone doesn't solve the problem and neither does pip unless you take extra steps.

    Here's a simple use case:

    I open source a web app written in Flask and push it to GitHub today with a requirements.txt file that only has top level dependencies (such as Flask, SQLAlchemy, etc.) included, all down to their exact patch version.

    You come in 3 months from now and clone the project and run docker-compose build.

    At this point in time you're going to get different versions than I had 3 months ago for many sub-dependencies. This could result in broken builds. This happened multiple times with Celery and its sub-dependency of Vine and Flask with its sub-dependency of Werkzeug.

    So the answer is simple right, just pip freeze your requirements.txt file. That works but now you have 100 dependencies in this file when really only about 8 of them are top level dependencies. It becomes a nightmare to maintain that as a human. You basically need to become a human dependency resolution machine that traces every dependency to each dependency.

    Fortunately pip has an answer to this with the -c flag but for such a big problem it's not very well documented or talked about.

    It is a solvable problem tho, to have a separate lock file with pip without using any external tools and the solution works with and without Docker. I have an example of it in this Docker Flask repo https://github.com/nickjj/docker-flask-example#updating-depe..., but it'll work without Docker too.

  • Dockerfile Best Practices
    news.ycombinator.com | 2021-01-02
    I have one here: https://github.com/nickjj/docker-flask-example/blob/ca1d4849...

    The basic idea is you create a user in your Dockerfile, switch to that user with the USER instruction and now future instructions in your Dockerfile will be run as that user.

    Also when COPY'ing you'll want to add --chown myuser:myuser too.

    The above Dockerfile shows examples of all of that.

    I'm not a fan of customizing the UID / GID because then in development with volumes you can get into trouble. Technically you could put UID / GID as build arguments but in practice I never ran into a scenario where this was needed because 99% of the time on a dev box your uid:gid will be 1000:1000 and in production chances are you are in control of provisioning your VPS so your deploy user will be 1000:1000. Also you probably won't be using volumes, but if you did it will work out of the box.

Stats

Basic docker-flask-example repo stats
16
192
8.3
15 days ago

nickjj/docker-flask-example is an open source project licensed under MIT License which is an OSI approved license.

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
Find remote jobs at our new job board 99remotejobs.com. There are 37 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.