Skip to content
Snippets Groups Projects
Dockerfile 855 B
Newer Older
  • Learn to ignore specific revisions
  • Jonas Leder's avatar
    Jonas Leder committed
    FROM python:3
    
    
    LABEL Name=url_shorter
    
    Jonas Leder's avatar
    Jonas Leder committed
    EXPOSE 5000
    
    
    Jonas Leder's avatar
    Jonas Leder committed
    #Copy files to work directory
    
    Jonas Leder's avatar
    Jonas Leder committed
    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
    
    COPY VERSION /app/VERISON
    
    COPY requirements.txt /app/requirements.txt
    
    Jonas Leder's avatar
    Jonas Leder committed
    
    
    #Make a complete system update. apt-utils is needed for configuring packages, so we need to install it
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN apt update
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN apt install apt-utils -y
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN apt upgrade -y
    
    Jonas Leder's avatar
    Jonas Leder committed
    
    
    #Install libraries
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN python3 -m pip install -r requirements.txt
    
    #Compile the Python files (for more speed) and replace the original files
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN python3 compile.py
    
    Jonas Leder's avatar
    Jonas Leder committed
    
    #Make a builddate file, used if you want to see the builddate in the webui
    RUN date > builddate.txt
    
    #everytime the container starts run main.py
    
    Jonas Leder's avatar
    .  
    Jonas Leder committed
    ENTRYPOINT python3 main.py