2 Welcome to Code Review!
source | link

Can this dockerfile be refactored? (python + react) Dockerfile to install Python and React in Linux container

This is my first question here, so bare with me...

I am learning how to use Docker. I'm creating a container that contains Python and React. This code works, but it seems so heavy when I install it. I only want React, but to get React, I install Node so I can use npm later on. Do you see ways to optimize this? Or are there any red flags?

Dockerfile:

FROM python:3.6-slim

# first two are for python, last five are for node
RUN apt-get update && \
    apt-get install -qq -y build-essential libpq-dev --no-install-recommends && \
    apt-get install -y curl && \
    apt-get -y autoclean && \
    curl -sL https://deb.nodesource.com/setup_5.x | bash && \
    apt-get install -y nodejs && \
    apt-get autoremove -y

# install python components
ENV INSTALL_PATH /brainlint
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
RUN pip3 install --editable .
CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "brainlint.app:create_app()"

Requirements.txt:

Flask==0.12.2
gunicorn==19.7.1

Can this dockerfile be refactored? (python + react)

This is my first question here, so bare with me...

I am learning how to use Docker. I'm creating a container that contains Python and React. This code works, but it seems so heavy when I install it. I only want React, but to get React, I install Node so I can use npm later on. Do you see ways to optimize this? Or are there any red flags?

Dockerfile:

FROM python:3.6-slim

# first two are for python, last five are for node
RUN apt-get update && \
    apt-get install -qq -y build-essential libpq-dev --no-install-recommends && \
    apt-get install -y curl && \
    apt-get -y autoclean && \
    curl -sL https://deb.nodesource.com/setup_5.x | bash && \
    apt-get install -y nodejs && \
    apt-get autoremove -y

# install python components
ENV INSTALL_PATH /brainlint
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
RUN pip3 install --editable .
CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "brainlint.app:create_app()"

Requirements.txt:

Flask==0.12.2
gunicorn==19.7.1

Dockerfile to install Python and React in Linux container

I am learning how to use Docker. I'm creating a container that contains Python and React. This code works, but it seems so heavy when I install it. I only want React, but to get React, I install Node so I can use npm later on. Do you see ways to optimize this? Or are there any red flags?

Dockerfile:

FROM python:3.6-slim

# first two are for python, last five are for node
RUN apt-get update && \
    apt-get install -qq -y build-essential libpq-dev --no-install-recommends && \
    apt-get install -y curl && \
    apt-get -y autoclean && \
    curl -sL https://deb.nodesource.com/setup_5.x | bash && \
    apt-get install -y nodejs && \
    apt-get autoremove -y

# install python components
ENV INSTALL_PATH /brainlint
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
RUN pip3 install --editable .
CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "brainlint.app:create_app()"

Requirements.txt:

Flask==0.12.2
gunicorn==19.7.1
1
source | link

Can this dockerfile be refactored? (python + react)

This is my first question here, so bare with me...

I am learning how to use Docker. I'm creating a container that contains Python and React. This code works, but it seems so heavy when I install it. I only want React, but to get React, I install Node so I can use npm later on. Do you see ways to optimize this? Or are there any red flags?

Dockerfile:

FROM python:3.6-slim

# first two are for python, last five are for node
RUN apt-get update && \
    apt-get install -qq -y build-essential libpq-dev --no-install-recommends && \
    apt-get install -y curl && \
    apt-get -y autoclean && \
    curl -sL https://deb.nodesource.com/setup_5.x | bash && \
    apt-get install -y nodejs && \
    apt-get autoremove -y

# install python components
ENV INSTALL_PATH /brainlint
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
RUN pip3 install --editable .
CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "brainlint.app:create_app()"

Requirements.txt:

Flask==0.12.2
gunicorn==19.7.1