Skip to content
Snippets Groups Projects
Dockerfile 667 B
Newer Older
  • Learn to ignore specific revisions
  • Jonas Leder's avatar
    Jonas Leder committed
    FROM python:3
    
    Jonas Leder's avatar
    Jonas Leder committed
    
    
    Jonas Leder's avatar
    Jonas Leder committed
    LABEL Name=url_shorter Version=1.1.4
    
    Jonas Leder's avatar
    Jonas Leder committed
    EXPOSE 5000
    
    WORKDIR /app
    
    ADD ./static /app/static
    ADD ./templates /app/templates
    COPY import.py /app/import.py
    
    COPY export.py /app/export.py
    
    COPY main.py /app/main.py
    
    Jonas Leder's avatar
    Jonas Leder committed
    
    
    #Make a complete system update
    
    RUN apt update
    RUN apt upgrade -y
    
    
    #Install pipreqs. this tool is used to make the requirements.txt file automatic
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN pip install pipreqs
    RUN pipreqs . --force
    
    #Install all required python libs
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN python3 -m pip install -r requirements.txt
    
    
    #Make a builddate file, used if you want to see the builddate in the webui
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN date > builddate.txt
    
    #everytime the container starts run main.py
    
    ENTRYPOINT python3 main.py