SHARE
TWEET

Untitled

a guest Aug 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. docker-compose.yml
  2.  
  3. version: '3'
  4.  
  5. services:
  6. db:
  7. env_file:
  8. - .env.ci
  9. image: ${REGISTRY_URL}/mysql:5.7-ci-custom
  10. environment:
  11. MYSQL_ROOT_PASSWORD: $DATABASE_ROOT_PASSWORD
  12. MYSQL_USER: $DATABASE_MASTER_USER
  13. MYSQL_PASSWORD: $DATABASE_MASTER_PASSWORD
  14. MYSQL_DATABASE: $DATABASE_MASTER_NAME
  15. networks:
  16. - signature
  17. ports:
  18. - '${DATABASE_PORT}'
  19. command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci --bind-address="0.0.0.0"
  20.  
  21. django:
  22. depends_on:
  23. - db
  24. - redis
  25. - elasticsearch
  26. env_file:
  27. - .env.ci
  28. build:
  29. context: .
  30. dockerfile: docker/backend/Dockerfile.ci
  31. args:
  32. PROJECT_DIR: $PROJECT_DIR
  33. USER: $DJANGO_USER
  34. USER_GROUP: $DJANGO_USER_GROUP
  35. USER_PASSWORD: $DJANGO_USER_PASSWORD
  36. REGISTRY_URL: $REGISTRY_URL
  37. volumes:
  38. - ./backend:$PROJECT_DIR/backend
  39. networks:
  40. - signature
  41. command: 'wait-for-it.sh "${DATABASE_MASTER_HOST}:${DATABASE_PORT}" --
  42. bash -c "flake8 && py.test"'
  43.  
  44. redis:
  45. image: ${REGISTRY_URL}/redis:latest
  46. networks:
  47. - signature
  48. ports:
  49. - '${REDIS_PORT}'
  50.  
  51. elasticsearch:
  52. image: ${REGISTRY_URL}/elasticsearch:2-custom
  53. environment:
  54. - bootstrap.memory_lock=true
  55. - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
  56. volumes:
  57. - esdata:/usr/share/elasticsearch/data
  58. ulimits:
  59. memlock:
  60. soft: -1
  61. hard: -1
  62. networks:
  63. - signature
  64. ports:
  65. - '${ELASTICSEARCH_PORT}'
  66.  
  67. networks:
  68. signature:
  69. driver: bridge
  70.  
  71. volumes:
  72. mysql-data:
  73. driver: local
  74. esdata:
  75. driver: local
  76.  
  77. *************************
  78. Dockerfile
  79. ARG REGISTRY_URL
  80. FROM ${REGISTRY_URL}/python:3.6-stretch-custom
  81.  
  82. ARG PROJECT_DIR
  83.  
  84. ARG USER
  85. ARG USER_GROUP
  86. ARG USER_PASSWORD
  87.  
  88. RUN useradd -m $USER -p $USER_PASSWORD && \
  89. groupadd $USER_GROUP && \
  90. usermod -a -G $USER_GROUP $USER && \
  91. apt-get update && \
  92. apt-get install -y --no-install-recommends \
  93. locales-all gettext netcat && \
  94. apt-get autoremove -y && \
  95. apt-get clean
  96.  
  97. WORKDIR $PROJECT_DIR/backend
  98.  
  99. COPY backend/requirements/*.txt ./requirements/
  100.  
  101. RUN pip install pip --upgrade && \
  102. pip install -r requirements/dev.txt --no-cache-dir
  103.  
  104. COPY docker/utils/wait-for-it.sh /usr/local/bin/
  105. RUN chmod +x /usr/local/bin/wait-for-it.sh
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top