-
image: myDockerHubUsername/ILikeHavingVersions:1540227811
-> I build this image with something likedocker build -t image: myDockerHubUsername/ILikeHavingVersions:1540227811 .
in my saleor fork repo. -
traefik handles TLS / letsencrypt / domain names
-
socket = :$(PORT)
instead ofsocket-http
because I'm usinguwsgi_params
anduwsgi_pass
: nginx uses the wsgi protocol, not HTTP, to communicate with saleor -
and this is because I got 4CPU HT, so I'm using 4 processes with 2 threads each:
processes = 4 threads = 2 enable-threads = True
-
-
Save vhf/c6c7ee56c0e414495c374619c8c5c500 to your computer and use it in GitHub Desktop.
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: | |
traefik: | |
restart: always | |
image: traefik:1.7.3 | |
command: --docker --configFile=/etc/traefik/traefik.toml | |
ports: | |
- 80:80 | |
- 443:443 | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /opt/traefik/traefik.toml:/etc/traefik/traefik.toml | |
- /opt/traefik/log:/log:rw | |
- /opt/traefik/acme:/etc/traefik/acme | |
redis: | |
restart: always | |
image: library/redis:4 | |
volumes: | |
- /opt/redis:/data | |
expose: | |
- 6379 | |
saleor: | |
restart: always | |
image: myDockerHubUsername/ILikeHavingVersions:1540227811 | |
env_file: prod.env | |
expose: | |
- 8000 | |
volumes: | |
- /opt/media:/app/media:Z | |
- /opt/static:/app/static:Z | |
links: | |
- postgres:db | |
- elasticsearch:search | |
- redis:redis | |
nginx: | |
restart: always | |
image: nginx:1 | |
volumes: | |
- /opt/nginx/saleor.conf:/etc/nginx/conf.d/default.conf | |
- /opt/media:/media | |
- /opt/static:/static | |
labels: | |
traefik.frontend.rule: Host:example.com,www.example.com | |
traefik.enable: 'true' | |
traefik.frontend.redirect.replacement: https://example.com$${1} | |
traefik.frontend.redirect.regex: ^https?://www.example.com(/?.*) | |
traefik.backend.loadbalancer.stickiness: 'true' | |
traefik.port: '80' | |
links: | |
- saleor:saleor | |
elasticsearch: | |
restart: always | |
image: elasticsearch:5.4.3 | |
environment: | |
ES_JAVA_OPTS: -Xms512m -Xmx512m | |
volumes: | |
- /opt/elasticsearch/data:/usr/share/elasticsearch/data | |
- /opt/elasticsearch/logs:/usr/share/elasticsearch/logs | |
postgres: | |
restart: always | |
image: library/postgres:10 | |
env_file: prod.env | |
volumes: | |
- /opt/postgres:/var/lib/postgresql/data | |
celery: | |
restart: always | |
image: myDockerHubUsername/ILikeHavingVersions:1540227811 | |
env_file: prod.env | |
volumes: | |
- /opt/media:/app/media:Z | |
links: | |
- postgres:db | |
- elasticsearch:search | |
- redis:redis | |
command: | |
- celery | |
- -A | |
- saleor | |
- worker | |
- --app=saleor.celeryconf:app | |
- --loglevel=info |
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
thumbnails: | |
docker-compose exec saleor python manage.py create_thumbnails | |
migrate: | |
docker-compose exec saleor python manage.py migrate | |
collect: | |
docker-compose exec saleor python manage.py collectstatic |
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
CACHE_URL=redis://redis:6379/0 | |
CELERY_BROKER_URL=redis://redis:6379/1 | |
DATABASE_URL=postgres://foobar:bazqux@db/saleor | |
DEFAULT_COUNTRY=US | |
DEFAULT_CURRENCY=USD | |
DEFAULT_FROM_EMAIL=contact@example.com | |
ELASTICSEARCH_URL=http://search:9200 | |
EMAIL_URL=smtp://contact%40example.com:smtpPassword@mail.example.com:587/?tls=True | |
JWT_VERIFY_EXPIRATION=True | |
VATLAYER_ACCESS_KEY=yellow | |
SECRET_KEY=submarine | |
ALLOWED_HOSTS=localhost,example.com,www.example.com | |
SENTRY_DSN=https://IAM:VERYSAFE@sentry.example.com/2?verify_ssl=0 | |
GOOGLE_ANALYTICS_TRACKING_ID=UA-HEY_YOU-1 | |
PAYPAL_USERNAME=hey | |
PAYPAL_ENDPOINT=https://api.sandbox.paypal.com | |
PAYPAL_SECRET=jude | |
DEBUG=False | |
ENABLE_SSL=True | |
POSTGRES_USER=foobar | |
POSTGRES_PASSWORD=bazqux | |
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
upstream django { | |
server saleor:8000; # name of the container, exposed port | |
} | |
# configuration of the server | |
server { | |
# the port your site will be served on | |
listen 80 default_server; | |
server_name _; | |
# the domain name it will serve for | |
charset utf-8; | |
# max upload size | |
client_max_body_size 75M; # adjust to taste | |
# Django media | |
location /media { | |
alias /media; | |
} | |
location /static { | |
alias /static; | |
} | |
# Finally, send all non-media requests to the Django server. | |
location / { | |
uwsgi_pass django; | |
include uwsgi_params; | |
} | |
} |
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
[uwsgi] | |
die-on-term = true | |
socket = :$(PORT) | |
log-format = UWSGI uwsgi "%(method) %(uri) %(proto)" %(status) %(size) %(msecs)ms [PID:%(pid):Worker-%(wid)] [RSS:%(rssM)MB] | |
master = true | |
max-requests = 2500 | |
memory-report = true | |
module = saleor.wsgi:application | |
processes = 4 | |
threads = 2 | |
enable-threads = True | |
mimefile = /etc/mime.types |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment