Skip to content

Commit

Permalink
docker: update docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiaro authored and michaelwood committed Sep 18, 2024
1 parent 1cb2b89 commit cd89252
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM python:3.8.16-bullseye
FROM python:3.8

RUN mkdir /code
COPY . /code/
WORKDIR /code/
RUN pip install -r /code/requirements.txt
RUN apt-get -qq -y update && apt-get -qq -y upgrade
RUN apt-get install -y chromium netcat-traditional

# This CMD never actually used; currently Docker Compose replaces it.
# Should be command for production web server later.
CMD sh -c ' ls'
COPY requirements_dev.txt /grantnav/
WORKDIR /grantnav/
RUN pip install -r requirements_dev.txt

EXPOSE 8000

CMD ["/bin/bash"]
13 changes: 8 additions & 5 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ services:
environment:
DEBUG: 'True'
ELASTICSEARCH_HOST: 'elasticsearch'
PROVENANCE_JSON: "/code/datastoredata/data/data_all.json"
PYTHONUNBUFFERED: 1
volumes:
- "./:/code"
- "./:/grantnav"
command: "sh -c 'python manage.py migrate && python manage.py runserver 0.0.0.0:8000'"
depends_on:
- elasticsearch

elasticsearch:
image: elasticsearch:7.12.1
image: elasticsearch:7.17.23
environment:
"discovery.type": 'single-node'
"TAKE_FILE_OWNERSHIP": "True"
ports:
- "9200:9200"
- "9300:9300"
volumes:
- "./elasticsearch_dev_data:/usr/share/elasticsearch/data/"

- "elasticsearch_data:/usr/share/elasticsearch/data/"

volumes:
elasticsearch_data: {}
34 changes: 17 additions & 17 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ version: "3.5"
services:

grantnav-test:
build: .
ports:
- "8000:8000"
environment:
ALLOWED_HOSTS: 'localhost'
DEBUG: 'True'
ELASTICSEARCH_HOST: 'elasticsearch-test'
PROVENANCE_JSON: "/code/datastoredata/data/data_all.json"
volumes:
- "./:/code"
command: "su -c 'chmod a+x docker-compose.test.sh && ./docker-compose.test.sh'"
depends_on:
- elasticsearch-test
build: .
tty: true
environment:
ALLOWED_HOSTS: 'localhost'
DEBUG: 'True'
PYTHONUNBUFFERED: 1
ELASTICSEARCH_HOST: 'elasticsearch'
volumes:
- "./:/grantnav"
depends_on:
- elasticsearch

elasticsearch-test:
image: elasticsearch:7.12.1
elasticsearch:
image: elasticsearch:7.17.23
environment:
"discovery.type": 'single-node'
"TAKE_FILE_OWNERSHIP": "True"
ports:
- "9200:9200"
- "9300:9300"
volumes:
- "./elasticsearch_test_data:/usr/share/elasticsearch/data/"

- "elasticsearch_data:/usr/share/elasticsearch/data/"

volumes:
elasticsearch_data: {}

0 comments on commit cd89252

Please sign in to comment.