Commit c13bc9b6 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Working infra.

parent 5ab4189c
server {
listen 80;
server_name www.example.com;
location /nomadxt {
root /app/;
root /app/;
}
location /nomadxt/api {
proxy_set_header Host $http_host;
proxy_pass http://api:8000;
}
location ~ ^/nomadxt/objects/(.*)$ {
resolver 127.0.0.11 ipv6=off; # docker embedded DNS
proxy_pass http://minio:9000/$1;
client_max_body_size 20g;
resolver 127.0.0.11 ipv6=off; # docker embedded DNS
proxy_set_header Host $http_host;
proxy_pass http://minio:9000/$1;
}
}
......@@ -25,12 +25,25 @@ services:
- ${MINIO_HOST_PORT}:9000
volumes:
- ${VOLUME_BINDS}/minio:/data
- ../config/minio:/root/.minio
environment:
- MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
- MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
command: server /data
minio-config:
image: minio/mc
links:
- minio
entrypoint: /bin/sh -c "
sleep 5;
/usr/bin/mc config host add minio http://minio:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY;
/usr/bin/mc mb minio/uploads -p;
/usr/bin/mc mb minio/archive -p;
/usr/bin/mc mb minio/repository -p;
/usr/bin/mc policy download minio/repository;
/usr/bin/mc policy download minio/archive;
/usr/bin/mc policy upload minio/uploads;"
# broker for celery
rabbitmq:
restart: always
......
#!/bin/sh
docker-compose up minio rabbitmq redis
\ No newline at end of file
......@@ -30,10 +30,13 @@ if me is None:
def _external_objects_url(url):
""" Replaces the given internal object storage url (minio) with an URL that allows
external access. """
port_with_color = '' if config.services.objects_port > 0 else ':%d' % config.services.objects_port
port_with_colon = ''
if config.services.objects_port > 0:
port_with_colon = ':%d' % config.services.objects_port
return url.replace(
'%s:%s' % (config.minio.host, config.minio.port),
'%s:%s%s' % (config.services.objects_host, port_with_color, config.services.objects_base_path))
'%s%s%s' % (config.services.objects_host, port_with_colon, config.services.objects_base_path))
class Uploads(Resource):
......@@ -50,6 +53,7 @@ class Uploads(Resource):
'name': upload.name,
'upload_id': upload.upload_id,
'presigned_url': _external_objects_url(upload.presigned_url),
'presigned_orig': upload.presigned_url,
'create_time': upload.create_time.isoformat() if upload.create_time is not None else None,
'upload_time': upload.upload_time.isoformat() if upload.upload_time is not None else None,
'proc_time': upload.proc_time.isoformat() if upload.proc_time is not None else None,
......
......@@ -92,6 +92,6 @@ logstash = LogstashConfig(
services = NomadServicesConfig(
api_base_path=os.environ.get('NOMAD_API_BASE_PATH', ''),
objects_host=os.environ.get('NOMAD_OBJECTS_HOST', 'localhost'),
objects_port=int(os.environ.get('NOMAD_OBJECTS_PORT', -1)),
objects_port=int(os.environ.get('NOMAD_OBJECTS_PORT', minio.port)),
objects_base_path=os.environ.get('NOMAD_OBJECTS_BASE_PATH', '')
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment