Skip to content

Instantly share code, notes, and snippets.

@owenvoke
Created September 30, 2020 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owenvoke/77781c86abe0cfb0887c612e40150ebd to your computer and use it in GitHub Desktop.
Save owenvoke/77781c86abe0cfb0887c612e40150ebd to your computer and use it in GitHub Desktop.
A Dockerfile for Laravel Zero PHAR distribution
# Set the required PHP version
FROM php:7.3-cli
# Set the name of your application binary
ARG APP_NAME=application
# Update global packages for the container
RUN apt-get update
# Install any required PHP extensions
# RUN docker-php-ext-install zip
# Copy the PHAR build into the container
COPY ./builds/$APP_NAME /app/application
# Allow the application to be run
RUN cd /app && chmod a+x /app/application
# Run the app by default
ENTRYPOINT ["php", "/app/application"]
@owenvoke
Copy link
Author

Building your application container

docker build -t [application-name] --build-arg APP_NAME=[application-name] .

Alternatively, you can update the APP_NAME argument in the Dockerfile instead.

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