File size: 2,861 Bytes
96283ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM nvcr.io/nvidia/pytorch:23.05-py3

# specify vscode as the user name in the docker
# This user name should match that of the VS Code .devcontainer to allow seamless development inside the docker container via vscode 
ARG USERNAME=vscode
ARG USER_UID=1001
ARG USER_GID=$USER_UID

# Create a non-root user
RUN groupadd --gid $USER_GID $USERNAME \
  && useradd -l -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
  # [Optional] Add sudo support for the non-root user - this is ok for development dockers only
  && apt-get update \
  && apt-get install -y sudo \
  && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
  && chmod 0440 /etc/sudoers.d/$USERNAME \
  # Cleanup
  && rm -rf /var/lib/apt/lists/* \
  # Set up git completion.
  && echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc 

# Packages installation (eg git-lfs)
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install --no-install-recommends curl git-lfs ffmpeg libsm6 libxext6 graphviz libgraphviz-dev libsndfile1-dev xdg-utils swig gringo gobject-introspection libcairo2-dev libgirepository1.0-dev pkg-config python3-dev python3-gi

COPY docker/docker-font.conf /etc/fonts/local.conf
#ENV FREETYPE_PROPERTIES="truetype:interpreter-version=35"
RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
RUN apt-get update \
	&& apt-get install -y --no-install-recommends fontconfig ttf-mscorefonts-installer


USER vscode

# ACT for executing locally Github workflows
RUN curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh |  sudo bash

# NVM for managing npm versions
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh |  sudo bash

# Git LFS repo configuration
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh |  sudo  bash

# inscape installation for managing svg files
RUN sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && sudo apt-get -y install --no-install-recommends inkscape

SHELL ["/bin/bash", "-c"]
ENV PATH="/home/vscode/.local/bin:$PATH"
ENV GI_TYPELIB_PATH="/usr/lib/x86_64-linux-gnu/girepository-1.0"

# RUN python -m pip install pip-tools
# https://github.com/jazzband/pip-tools/issues/1596
#RUN --mount=type=cache,target=/root/.cache/pip python3 -m piptools compile -v 


# Install dependencies:
# COPY requirements.txt /tmp/requirements.txt
# RUN pip install -r /tmp/requirements.txt

RUN pip install --upgrade pip 
# && \
#     pip install pipenv  && \
#     pipenv lock && \
#     pipenv install --dev --system && \ 
#     pipenv --clear
RUN pip install pipenv
COPY Pipfile.lock Pipfile /tmp/
WORKDIR /tmp
RUN pipenv install --system --deploy --ignore-pipfile

WORKDIR /workspaces/artificial_intelligence

COPY . .