Skip to content
Permalink
Browse files

Merge pull request #1 from marcomontalbano/docker

Add docker-compose
  • Loading branch information...
marcomontalbano committed Sep 19, 2019
2 parents 729c9dd + 9d757d6 commit 7299c3441c856acdccf9b2c4c9428be2865dd8f7
@@ -3,3 +3,4 @@ CLOUDINARY_CLOUD_NAME=
FACEBOOK_ACCESS_TOKEN=
SITE_ID=
NETLIFY_ACCESS_TOKEN=
GA_TRACKING_ID=
@@ -8,7 +8,7 @@ const netlify = require('../src/lambda/netlify');
const dbPath = `${__dirname}/../src/db.json`;

fs.writeFileSync(dbPath, '{}');
netlify.handler({}, {}, (error, content) => {
netlify.handler({ path: '/netlify' }, {}, (error, content) => {
const netlify = JSON.parse(content.body);
fs.writeFileSync(dbPath, JSON.stringify({ netlify }, undefined, 2));
});
@@ -0,0 +1,22 @@
version: "3.7"
services:

nginx:
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./dist/client:/var/www/html
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- lambda_functions

lambda_functions:
image: node:alpine
environment:
NODE_ENV: production
working_dir: /home/app
restart: always
volumes:
- ./:/home/app
command: ["npm", "run", "start:server"]
@@ -0,0 +1,16 @@
server {
listen 80;
root /var/www/html;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

location / {
try_files $uri $uri/ =404;
}

location /.netlify/functions {
proxy_pass http://lambda_functions:8081/.netlify/functions;
}
}

0 comments on commit 7299c34

Please sign in to comment.
You can’t perform that action at this time.