Skip to content

Commit

Permalink
added leaner dev-friendly compose to ease devel
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed May 9, 2024
1 parent df114cf commit bfa84ac
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 8 deletions.
Empty file modified backend/entrypoint.sh
100644 → 100755
Empty file.
15 changes: 9 additions & 6 deletions dev/backend-tools-tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ RUN apt-get update -y \
&& apt-get install -y --no-install-recommends libmagic1 redis-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY rq-worker /usr/local/bin
COPY pyproject.toml README.md tasks.py entrypoint.sh /app/
COPY api/__about__.py /app/api/
RUN chmod a+x /usr/local/bin/rq-worker \
&& cd /app \
&& chmod +x /app/entrypoint.sh \
&& pip install --no-cache-dir -U pip \
&& cd /app \
&& pip install --no-cache-dir -e .[dev]
COPY api/ /app/api
COPY tests /app/tests
COPY alembic.ini /app/alembic.ini
COPY migrations/ /app/migrations

RUN cd /app && \
chmod +x /app/entrypoint.sh && \
pip install --no-cache-dir -U pip && \
cd /app && pip install --no-cache-dir -e .[dev]
COPY README.md /app

WORKDIR /app
COPY README.md /app

ENTRYPOINT [ "/app/entrypoint.sh" ]
CMD ["/bin/sh"]
3 changes: 1 addition & 2 deletions dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ services:
- NAUTILUS_PROJECT_QUOTA=${NAUTILUS_PROJECT_QUOTA}
- NAUTILUS_FILE_REFRESH_EVERY_MS=${NAUTILUS_FILE_REFRESH_EVERY_MS}
depends_on:
- backend
- backend-dev
backend-dev:
build:
dockerfile: ../dev/backend-tools-tests/Dockerfile
Expand All @@ -100,7 +100,6 @@ services:
- backend_storage:/storage
- ../backend:/app
container_name: nautilus-backend-dev
entrypoint: ''
command: fastapi dev --host 0.0.0.0 --port 80 api/entrypoint.py
ports:
- 8083:80
Expand Down
95 changes: 95 additions & 0 deletions dev/reload-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
services:
database:
image: postgres:15.3-bullseye
container_name: nautilus-database
restart: always
volumes:
- pg_data_nautilus:/var/lib/postgresql/data
environment:
- POSTGRES_USER=nautilus
- POSTGRES_PASSWORD=nautilus
- POSTGRES_DB=nautilus
- POSTGRES_PORT=5432
ports:
- 5432:5432
healthcheck:
test: pg_isready -U nautilus
interval: 3s
retries: 10
redis:
image: redis:7.2
container_name: nautilus-redis
restart: always
volumes:
- pg_data_redis:/data
ports:
- 6379:6379
healthcheck:
test: redis-cli ping
interval: 3s
retries: 10
worker:
build:
dockerfile: ../dev/backend-tools-tests/Dockerfile
context: ../backend
volumes:
- backend_storage:/storage
- ../backend:/app
container_name: nautilus-backend-worker
environment:
- POSTGRES_URI=${POSTGRES_URI}
- REDIS_URI=${REDIS_URI}
- S3_URL_WITH_CREDENTIALS=${S3_URL_WITH_CREDENTIALS}
- PRIVATE_SALT=secrectkey
- TRANSIENT_STORAGE_PATH=/storage
- CHANNEL_NAME=${CHANNEL_NAME}
entrypoint: ''
command: ["rq-worker"]
depends_on:
- backend-dev
frontend-dev:
build:
dockerfile: ../dev/frontend-tools/Dockerfile
context: ../frontend
container_name: nautilus-frontend-dev
volumes:
- ../frontend/public:/src/public
- ../frontend/src:/src/src
ports:
- 8082:80
environment:
- NAUTILUS_WEB_API=http://localhost:8083/v1
- NAUTILUS_FILE_QUOTA=${NAUTILUS_FILE_QUOTA}
- NAUTILUS_PROJECT_QUOTA=${NAUTILUS_PROJECT_QUOTA}
- NAUTILUS_FILE_REFRESH_EVERY_MS=${NAUTILUS_FILE_REFRESH_EVERY_MS}
depends_on:
- backend-dev
backend-dev:
build:
dockerfile: ../dev/backend-tools-tests/Dockerfile
context: ../backend
volumes:
- backend_storage:/storage
- ../backend:/app
container_name: nautilus-backend-dev
command: fastapi dev --host 0.0.0.0 --port 80 api/entrypoint.py
ports:
- 8083:80
environment:
- POSTGRES_URI=${POSTGRES_URI}
- REDIS_URI=${REDIS_URI}
- S3_URL_WITH_CREDENTIALS=${S3_URL_WITH_CREDENTIALS}
- PRIVATE_SALT=secrectkey
- TRANSIENT_STORAGE_PATH=/storage
- CHANNEL_NAME=${CHANNEL_NAME}
- ALLOWED_ORIGINS=http://localhost:8081|http://localhost:8082
- RUN_DB_MIGRATIONS=y
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
volumes:
pg_data_nautilus:
pg_data_redis:
backend_storage:

0 comments on commit bfa84ac

Please sign in to comment.