## bdfr - Add the bound instance as method parameter - Change methods not using its bound instance to staticmethods - Fix dangerous default argument - Refactor the comparison involving `not` - Refactor unnecessary `else` / `elif` when `if` block has a `raise` statement - Refactor unnecessary `else` / `elif` when `if` block has a `return` statement - Refactor useless `else` block in the loop - Remove implicit `object` from the base class - Remove reimported module - Remove unnecessary generator - Remove unnecessary return statement - Remove unnecessary use of comprehension - Remove unused imports - Use `is` to compare type of objects - Using not x can cause unwanted results ## Dockerfile - use a pinned Python version tag instead of latest - leverage cached requirements Signed-off-by: Vladislav Doster <mvdoster@gmail.com> Co-authored-by: Ali Parlakçı <parlakciali@gmail.com>
32 lines
915 B
Docker
32 lines
915 B
Docker
# Bulk Downloader for Reddit
|
|
#
|
|
# VERSION 0.0.1
|
|
|
|
FROM python:3.8-slim-buster
|
|
LABEL Description="This image enables running Buld Downloader for Reddit with in a container environment" Version="0.0.1"
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
|
|
EXPOSE 8080
|
|
EXPOSE 7634
|
|
|
|
# Install dependencies for building Python packages
|
|
RUN apt-get update \
|
|
&& apt-get install -y build-essential \
|
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Requirements are installed here to ensure they will be cached.
|
|
COPY requirements.txt /requirements.txt
|
|
RUN pip install --no-cache-dir -r /requirements.txt \
|
|
&& rm -rf /requirements.txt
|
|
|
|
# Copy project files into container
|
|
COPY . /bdfr
|
|
WORKDIR /bdfr
|
|
|
|
# This is useful because the image name can double as a reference to the binary
|
|
ENTRYPOINT ["python", "script.py"]
|
|
CMD ["--help"]
|