Skip to content

Instantly share code, notes, and snippets.

@gilankpam
Created March 4, 2017 00:06
Show Gist options
  • Select an option

  • Save gilankpam/769642aef8e07303c672b846559dac4c to your computer and use it in GitHub Desktop.

Select an option

Save gilankpam/769642aef8e07303c672b846559dac4c to your computer and use it in GitHub Desktop.
Docker Compose php
FROM php:alpine
# Install composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php --install-dir=/bin --filename=composer && \
php -r "unlink('composer-setup.php');"
RUN mkdir /app
# Copy semua source code ke directory /app dalam docker container
ADD . /app
# Semacam cd (pindah directory) ke /app
WORKDIR /app
RUN composer install
EXPOSE 8080
CMD ["php", "-S", "0.0.0.0:8080"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment