Skip to content

Commit 36aeccf

Browse files
committed
working base for Docker testing
1 parent c72652c commit 36aeccf

5 files changed

+59
-2
lines changed

.dockerignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.github
2+
.img
3+
doc
4+
output
5+
.dockerignore
6+
.gitignore
7+
Docker-compose.yml
8+
Dockerfile
9+
LICENSE
10+
Makefile
11+
README.md

Docker-compose.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3.7'
2+
3+
services:
4+
osintgram:
5+
container_name: osintgram
6+
build: .

Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM python:3.9.2-alpine3.13 as build
2+
WORKDIR /wheels
3+
RUN apk add --no-cache \
4+
g++ \
5+
gcc \
6+
git \
7+
libxml2 \
8+
libxml2-dev \
9+
libxslt-dev \
10+
ncurses-dev \
11+
build-base \
12+
linux-headers
13+
COPY requirements.txt /opt/osintgram/
14+
RUN pip3 wheel -r /opt/osintgram/requirements.txt
15+
16+
17+
FROM python:3.9.2-alpine3.13
18+
WORKDIR /opt/osintgram
19+
RUN adduser -D osintgram
20+
RUN mkdir -p /opt/osintgram && chown -R osintgram:osintgram /opt/osintgram
21+
22+
COPY --from=build /wheels /wheels
23+
COPY --chown=osintgram:osintgram requirements.txt /opt/osintgram/
24+
RUN pip3 install -r requirements.txt -f /wheels \
25+
&& rm -rf /wheels \
26+
&& rm -rf /root/.cache/pip/* \
27+
&& rm requirements.txt
28+
29+
COPY --chown=osintgram:osintgram src/ /opt/osintgram/src
30+
COPY --chown=osintgram:osintgram main.py /opt/osintgram/
31+
32+
USER osintgram
33+
34+
ENTRYPOINT ["sleep", "infinity"]

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
make run:
2+
3+
echo "[#] Killing old docker processes"
4+
docker-compose rm -fs
5+
6+
echo "[#] Building docker containers"
7+
docker-compose up --build -d

requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ requests-toolbelt==0.9.1
33
geopy>=2.0.0
44
prettytable==0.7.2
55
instagram-private-api==1.6.0
6-
gnureadline>=8.0.0; platform_system != "Windows"
7-
pyreadline==2.1; platform_system == "Windows"
6+
gnureadline>=8.0.0

0 commit comments

Comments
 (0)