version: '2' networks: ghost: services: ghost-app: build: ghost networks: - ghost depends_on: - db ports: - "2368:2368" nginx: build: nginx networks: - ghost depends_on: - ghost-app ports: - "80:80" db: image: "mysql:5.7.15" networks: - ghost environment: MYSQL_ROOT_PASSWORD: mysqlroot MYSQL_USER: ghost MYSQL_PASSWORD: ghost volumes: - $PWD/data:/var/lib/mysql ports: - "3306:3306"
FROM ghost COPY ./config.js /var/lib/ghost/config.production.js EXPOSE 2368
var path = require('path'), config; config = { production: { url: 'http://mytestblog.com', mail: {}, database: { client: 'mysql', connection: { host : 'db', user : 'ghost', password : 'ghost', database : 'ghost', port: '3306', charset : 'utf8' }, debug: false }, paths: { contentPath: path.join(process.env.GHOST_CONTENT,'/') }, server: { host: '0.0.0.0', port: '2368' } } }; module.exports = config;
FROM nginx COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 80
worker_processes 1; events {worker_connections 1024;} http { server { listen 80; location / { proxy_pass http://ghost-app:2368; } } }