· 6 years ago · Jul 20, 2019, 05:04 AM
1version: "3.4"
2x-mailer:
3 &mailer
4 ADMIN_NAME: "Бендер Родригес"
5 ADMIN_EMAIL: 111@gmail.com
6 ADMIN_PASSWORD: 111
7 DOMAIN_NAME: gmail.com
8 SMTP_SERVER: smtp.gmail.com
9
10x-postgres_env:
11 &postgres_env
12 POSTGRES_HOST: postgresql
13 POSTGRES_PORT: 5432
14 POSTGRES_DB: asd_development
15 POSTGRES_USER: 111
16 POSTGRES_PASSWORD: 111
17
18
19services:
20 nginx:
21 image: nginx:1.11-alpine
22 volumes:
23 - ./docker/nginx:/conf
24 - ./public:/app/public
25 - ./log:/log
26 ports:
27 - 80:80
28 - 443:443
29 command: sh -c 'ln -sfn /conf/dev.nginx.conf /etc/nginx/conf.d/app.conf && sed -i -- "s/worker_processes 1;/worker_processes auto;/g" /etc/nginx/nginx.conf && exec nginx -g "daemon off;"'
30 depends_on:
31 - app
32 networks:
33 - net
34
35
36 postgresql:
37 image: mdillon/postgis:9.6-alpine
38 ports:
39 - "15432:5432"
40 networks:
41 - net
42 volumes:
43 - ./docker/db:/docker-entrypoint-initdb.d
44 - postgres-data:/var/lib/postgresql/data
45 environment:
46 <<: *postgres_env
47 app:
48 build:
49 context: ./
50 dockerfile: ./docker/backend/Dockerfile
51 volumes:
52 - .:/usr/src/app:cached
53 - app-gems:/usr/local/bundle
54 command: sh -c "./entrypoint-dev.sh && bundle install && bundle exec puma --config config/puma.rb"
55 depends_on:
56 - postgresql
57 networks:
58 - net
59
60 environment: &backend_env
61 RAILS_ENV: development
62 <<: *postgres_env
63 PG_PORT: 5432
64 PG_HOST: postgresql
65 PG_TIMEOUT: 5000
66 PG_POOL: 5
67 <<: *mailer
68 RAILS_LOG_TO_STDOUT: "true"
69 SECRET_KEY_BASE: heugbweruhbgwuer
70 stdin_open: true
71 tty: true
72
73networks:
74 net:
75 ipam:
76 driver: default
77
78volumes:
79 postgres-data:
80 driver: local
81 redis-data:
82 driver: local
83 app-gems:
84 driver: local