GithubHelp home page GithubHelp logo

apache-flask's Introduction

Debian - Python - Mod_Wsgi

This is the repo for running a python app under mod_wsgi on apache in a docker container

Many of the docker repo's out there use flask local server in their images. This repo is for a more production ready environment.

This repo will be built in stages It will contain a demo app written using the Flask framework

I will be using this Flask app for the repo

As of commit f232e60c39fcd480fbabab6308eeaf24f4a9d5ae The command to run the Dockerfile is:

docker run -d -p 80:80 --name <name> apache-flask

Alternatively, you can use docker-compose with:

docker-compose up -d

  • Download the repo
  • build the image: docker build -t apache-flask .

The docker file runs through the following steps:

  • get debian bullseye-slim image.
  • install the requirements for python and flask on debian
  • copy over the requirements.txt file and run pip install on it
  • This is copied separately so that the dependencies are cached and dont need to run everytime the image is rebuilt
  • copy over the application config file for apache
  • copy over the .wsgi file. This is the entrypoint for our application, the run.py file, and the application directory
  • enable the new apache config file and headers
  • dissable the default apache config file
  • expose port 80
  • point the container to the application directory
  • the run command.

apache-flask's People

Contributors

carlostighe avatar dependabot[bot] avatar nitzanel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

apache-flask's Issues

404 page not found

hello @Craicerjack,

I was setting up an application in flask + wsgi on the docker and I came across your settings. They helped me a lot.

After loading the containers and trying to access them externally, error 404 is occurring.

You inform the following: "# The commands below get apache running but there are issues accessing it online"

Can it be related to that?

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.