Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Production deployment files (#346)

Madison Swain-Bowdenc4c2dd545fa8
diff --git a/ingestion_server/README.md b/ingestion_server/README.md
index ac4dace5f..a3ae416c5 100644
--- a/ingestion_server/README.md
+++ b/ingestion_server/README.md
@@ -118,10 +118,12 @@ database_table_to_elasticsearch_model = {
}
```
-## Deployment (last deployed version: 1.20.0)
+## Deployment (last deployed version: 1.4.0)
This codebase is deployed as Docker image to Docker hub. The deployed image is then pulled in the production environment. See the [`./publish_release.sh`](publish_release.sh) script for deploying to Docker hub. The machine running the script must be logged into Docker as the Openverse account.
The current Docker hub image is at [openverse/ingestion_server](https://hub.docker.com/r/openverse/ingestion_server) but the image previously lived at [creativecommons/ingestion_server](https://hub.docker.com/r/creativecommons/ingestion_server).
The version numbering for the Docker image appears to be a standalone semver value, separate from the repository version.
+
+The published image can be deployed using the minimal [`docker-compose.yml`](docker-compose.yml) file defined in this folder (do not forget to update the `.env` file for production). The repository `justfile` can be used, but the environment variable `IS_PROD` must be set to `true` in order for it to reference the production `docker-compose.yml` file here.
diff --git a/ingestion_server/docker-compose.yml b/ingestion_server/docker-compose.yml
new file mode 100644
index 000000000..9b4ff5fbe
--- /dev/null
+++ b/ingestion_server/docker-compose.yml
@@ -0,0 +1,13 @@
+version: "2.4"
+services:
+ ingestion_server:
+ image: openverse/ingestion_server:1.4.0
+ ports:
+ - "8001:8001"
+ env_file:
+ - .env
+ dns:
+ # Related to DNS management on the production box.
+ # Not sure if this is strictly necessary, but it exists
+ # in the current, running system so we are retaining it here.
+ - 172.31.0.2
diff --git a/justfile b/justfile
index 6eb92912c..1c27af3b5 100644
--- a/justfile
+++ b/justfile
@@ -20,7 +20,11 @@ default:
# Docker #
##########
-DOCKER_FILE := "-f docker-compose.yml"
+IS_PROD := env_var_or_default("IS_PROD", "")
+DOCKER_FILE := "-f " + (
+ if IS_PROD == "true" {"ingestion_server/docker-compose.yml"}
+ else {"docker-compose.yml"}
+)
# Bring all Docker services up
up flags="":