-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
82 lines (65 loc) · 2.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Created by: George Corrêa de Araújo (george.gcac@gmail.com)
# ==================================================================
# FROM python:latest
FROM python:3.11
ARG GROUPID=901
ARG GROUPNAME=cleaner
ARG USERID=901
ARG USERNAME=user
# Environment variables
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="pip --no-cache-dir install --upgrade" && \
# ==================================================================
# Create a system group with name deeplearning and id 901 to avoid
# conflict with existing uids on the host system
# Create a system user with id 901 that belongs to group deeplearning
# ------------------------------------------------------------------
groupadd -r $GROUPNAME -g $GROUPID && \
# useradd -u $USERID -r -g $GROUPNAME $USERNAME && \
useradd -u $USERID -m -g $GROUPNAME $USERNAME && \
# ==================================================================
# libraries via apt-get
# ------------------------------------------------------------------
rm -rf /var/lib/apt/lists/* && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
curl \
python3-enchant \
locales \
wget && \
# ==================================================================
# python libraries via pip
# ------------------------------------------------------------------
$PIP_INSTALL \
pip \
wheel && \
$PIP_INSTALL \
colorama \
ftfy \
# inflect \
ipdb \
ipython \
nltk \
pandas \
pyarrow \
pyenchant \
pypdfium2 \
tqdm && \
# until these are merged into official inflect, use this fork
# https://github.com/jaraco/inflect/pull/167
# https://github.com/jaraco/inflect/pull/168
$PIP_INSTALL \
# git+https://github.com/george-gca/inflect@fix_s_plural_noun && \
git+https://github.com/george-gca/inflect && \
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
ldconfig && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* /tmp/* ~/*
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen
ENV LC_ALL pt_BR.UTF-8
USER $USERNAME