Created
July 8, 2019 07:43
-
-
Save mozhu1024/321f1c61f0323345abbef95ab7349549 to your computer and use it in GitHub Desktop.
[SecurityManageFramwork] Docker for SecurityManageFramwork #docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2" | |
services: | |
app: | |
build: . | |
image: virink/semf | |
command: /app/start.sh | |
ports: | |
- "127.0.0.1:8081:8000" | |
rabbitmq: | |
image: rabbitmq:3.7-alpine | |
volumes: | |
- ./enabled_plugins:/etc/rabbitmq/enabled_plugins | |
environment: | |
- RABBITMQ_VM_MEMORY_HIGH_WATERMARK=0.5 | |
- RABBITMQ_ERLANG_COOKIE=rabbitmq_erlang_secret | |
- RABBITMQ_DEFAULT_VHOST=semf | |
- RABBITMQ_DEFAULT_USER=semf | |
- RABBITMQ_DEFAULT_PASS=semf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3-alpine3.9 | |
# git clone https://gitee.com/gy071089/SecurityManageFramwork.git | |
# cd SecurityManageFramwork | |
COPY . /app/ | |
WORKDIR /app | |
# TODO: django -> django==2.1.7 | |
RUN python -m pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt | |
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apk/repositories && \ | |
apk update && \ | |
apk add sqlite nmap | |
RUN python manage.py makemigrations | |
RUN python manage.py migrate | |
# RUN python manage.py createsuperuser --username semf --email semf@secoo.com | |
RUN echo "from django.contrib.auth.models import User; User.objects.create_superuser('semf', 'semf@example.com', 'm9TwgEtA8TBC')" | python manage.py shell | |
RUN python initdata.py | |
CMD ["/app/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[rabbitmq_management]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
python -m celery -A SeMF worker -l info --autoscale=10,4 >> logs/celery.log 2>&1 & | |
echo "Start celery for semf" | |
python manage.py runserver 0.0.0.0:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name semf.example.cn; | |
server_tokens off; | |
access_log /var/log/nginx/semf_access.log; | |
error_log /var/log/nginx/semf_error.log; | |
location / { | |
proxy_pass http://127.0.0.1:8081/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment