Skip to content

Commit

Permalink
initial docker-compose setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Borg committed Apr 30, 2022
1 parent 5f9b48b commit 9276997
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Docker files for scio

Run analyze, tika-server and api:

```bash
sudo docker network create scio
cd docker
./run.sh
```

###
Remove all data from docker instance

```bash
docker-compose down --volumes
```

### Example queries that should have hits on sample data:

```
docker exec -it docker-app-1 /bin/bash
http_proxy= poetry run script/populate_sample_queries.sh $METASEARCH_APIKEY
```
6 changes: 6 additions & 0 deletions docker/beanstalkd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM docker.io/debian:buster

RUN apt update
RUN apt -y install beanstalkd

ENTRYPOINT ["/usr/bin/beanstalkd"]
98 changes: 98 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
version: '3.8'

networks:
scio:
external: true
name: scio

x-proxy: &proxy
http_proxy: http://10.0.1.11:3128
https_proxy: http://10.0.1.11:3128
no_proxy:

x-build-args: &build-args
args:
<<: *proxy

x-common: &common
networks:
- scio
logging:
options:
max-file: 5
max-size: 500m

x-meta-scio: &scio
build:
dockerfile: docker/scio/Dockerfile
context: ..
<<: *build-args
image: scio:dev
depends_on:
- elasticsearch
- beanstalkd
environment:
BEANSTALK: beanstalkd
ELASTICSEARCH: elasticsearch
http_proxy:
https_proxy:
volumes:
- cache-data:/home/scio/.cache/scio
deploy:
restart_policy:
condition: on-failure

services:
scio-tika-server:
<<: *common
<<: *scio
command: .local/bin/scio-tika-server

scio-analyze:
<<: *common
<<: *scio
command: .local/bin/scio-analyze

scio-api:
<<: *common
<<: *scio
command: .local/bin/scio-api
ports:
- 3000:3000
#- 127.0.0.1:3000:3000

beanstalkd:
<<: *common
build:
context: beanstalkd/
<<: *build-args
image: beanstalkd:dev
command: -l 0.0.0.0 -z 262140 -V
deploy:
restart_policy:
condition: on-failure

elasticsearch:
<<: *common
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
environment:
- node.name=elasticsearch
- cluster.name=scio
- discovery.type=single-node
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- ES_SETTING_INGEST_GEOIP_DOWNLOADER_ENABLED=false
- "ES_JAVA_OPTS=-Xms2048m -Xmx2048m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data

volumes:
elasticsearch-data:
driver: local
cache-data:
driver: local
7 changes: 7 additions & 0 deletions docker/resources/pip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[global]
index-url = http://artifactory.mnemonic.no/artifactory/api/pypi/virt-pypi/simple/
trusted-host = pypi.python.org artifactory.mnemonic.no
# proxy = http://intern-proxy.mnemonic.no:3128
timeout = 120
cert = /etc/ssl/certs
no-cache-dir = false
6 changes: 6 additions & 0 deletions docker/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

BASE=$(dirname $0)

cd $BASE
docker-compose up -d --build --remove-orphans
27 changes: 27 additions & 0 deletions docker/scio/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM docker.io/debian:buster

RUN apt update
RUN apt -y install curl inetutils-ping telnet python3 python3-setuptools python3-pip

RUN useradd -ms /bin/bash scio
USER scio

# All subsequent commands will be relative to /home/scio
WORKDIR /home/scio

RUN mkdir -p .config/pip scio/dist

COPY /docker/resources/pip.conf .config/pip
COPY /act scio/act
COPY /etc scio/etc
COPY /setup.py scio/setup.py
COPY /README.md scio/README.md

RUN mkdir -p /home/scio/.cache/scio
RUN chown scio:scio /home/scio/.cache/scio

RUN cd scio && \
rm -f dist/*gz && \
python3 setup.py sdist && \
pip3 install dist/*gz

0 comments on commit 9276997

Please sign in to comment.