-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (36 loc) · 1.16 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
# File: Dockerfile
# Author: Matus Remen ([email protected])
# Date: 2023/03/15
# Description: Dockerfile for CloneGuard
# Base image
FROM python:3.11-slim
# install system dependencies
RUN apt-get update -yqq && \
apt-get install -yqq curl git default-jdk cron systemctl && \
rm -rf /var/lib/apt/lists/*
# install poetry
RUN python -m pip install --upgrade pip
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/usr/local python3 - && \
poetry config virtualenvs.create false
# set working directory
WORKDIR /app
ENV PYTHONPATH "/app:${PYTHONPATH}"
# install python dependencies
COPY pyproject.toml poetry.lock /app/
RUN poetry check && \
poetry show --tree && \
poetry install --no-root
# include source code
COPY ./cloneguard /app/cloneguard
# configure git
RUN echo "[safe]" >> ~/.gitconfig && \
echo " directory = *" >> ~/.gitconfig && \
echo "" >> ~/.gitconfig && \
echo "[pull]" >> ~/.gitconfig && \
echo "ff = only" >> ~/.gitconfig
# easier access to cli
RUN echo "#!/bin/sh" > cli && \
echo "exec python3 cloneguard.cli $@" >> cli && \
chmod +x cli
# initiliaze nltk, download data sets
RUN python3 -m cloneguard.utils.nltk_init