Skip to content

Instantly share code, notes, and snippets.

@emmanuel-oliveira
Created November 18, 2023 21:27
Show Gist options
  • Select an option

  • Save emmanuel-oliveira/25c073cc0a2908c75a425ae597bb31ef to your computer and use it in GitHub Desktop.

Select an option

Save emmanuel-oliveira/25c073cc0a2908c75a425ae597bb31ef to your computer and use it in GitHub Desktop.
Example dockerfile python flask ubuntu
# Configurando o ambiente
FROM ubuntu:20.04
# Atualizando e instalando pacotes
RUN apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata \
&& apt-get -y install python3.8 python3-pip python3-venv wget curl \
libxml2-dev libxslt1-dev antiword unrtf poppler-utils pstotext tesseract-ocr \
flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig tesseract-ocr-por python3-dev \
unzip
# Instalando as dependências do Python
RUN python3 -m pip install --upgrade pip \
&& pip install -r requirements.txt
# Copiando os arquivos
COPY . /src/
WORKDIR /src
# Limpeza de cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Setando permissões de execução para o script start.sh
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Usando CMD em vez de ENTRYPOINT para scripts simples
CMD ["/start.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment