Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run applications locally with Bref Docker images #367

Conversation

Guillaume-Rossignol
Copy link
Contributor

@Guillaume-Rossignol Guillaume-Rossignol commented Jul 4, 2019

The goal of this pull request is to create Docker images that replicate the AWS Lambda environment locally. That will allow us to have a local development environment that is easier to use and faster than sam local or serverless invoke local.

runtime/php/Makefile Outdated Show resolved Hide resolved
runtime/php/readme.md Outdated Show resolved Hide resolved
runtime/php/readme.md Outdated Show resolved Hide resolved

COPY ./local/php-fpm.conf /opt/bref/etc/php-fpm.conf

CMD [ "php-fpm", "-F", "-y", "/opt/bref/etc/php-fpm.conf" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posting here so that we don't forget: we should populate the environment variables available on Lambda: https://docs.aws.amazon.com/lambda/latest/dg/lambda-environment-variables.html

@mnapoli mnapoli changed the title Local docker images Run applications locally with Bref Docker images Jul 10, 2019
deleugpn added a commit to deleugpn/bref that referenced this pull request Jul 10, 2019
Use docker image to generate layers files instead of export.sh script
@@ -8,7 +8,7 @@
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html
# AWS has kindly provided us with it as a base docker image.
# https://github.com/aws/amazon-linux-docker-images/tree/2017.03
FROM amazonlinux:2017.03
FROM amazonlinux:2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting on #332 to use 2018.03 instead.

runtime/layers/fpm-dev/Dockerfile Outdated Show resolved Hide resolved
@mnapoli
Copy link
Member

mnapoli commented Jul 27, 2019

Given this docker-compose.yml file:

version: "2.1"
services:
    cli:
        image: bref/php-73
        volumes:
            - .:/var/task
        command: 'false'

Then:

$ docker-compose run cli php bin/console
Could not open input file: console

$ docker-compose run cli php /var/task/bin/console
# works
# ...

Maybe the default directory should be /var/task? (I don't know if it's possible)

@mnapoli
Copy link
Member

mnapoli commented Jul 27, 2019

Trying to make externals.io use this: mnapoli/externals#119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants