Skip to content

Instantly share code, notes, and snippets.

@ribafs
Created April 16, 2022 11:46
Show Gist options
  • Save ribafs/fc904e967d2b81dd0c37e823424f9509 to your computer and use it in GitHub Desktop.
Save ribafs/fc904e967d2b81dd0c37e823424f9509 to your computer and use it in GitHub Desktop.
Simple PHP7.4, sqlite3, nodejs npm, for Alpine container Docker
FROM alpine
RUN apk add --no-cache curl sqlite gd openssl nodejs npm php7-intl php7-openssl php7-sqlite3 php7-tokenizer php7-common php7 php7-snmp php7-doc php7-fileinfo php7-mbstring php7-dev php7-xmlreader php7-pdo_sqlite php7-opcache php7-ldap php7-posix php7-session php7-gd php7-json php7-xml php7-iconv php7-curl php7-phar php7-imap php7-zip php7-ctype php7-bcmath php7-calendar php7-dom php7-sockets php7-dbg php7-ffi php7-ftp php7-sysvsem php7-pdo php7-bz2 php7-simplexml php7-xmlwriter
#install Composer
#check last composer intaller instructions
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/local/bin/composer
#enter the command below to build this image:
#non root user... $docker build --tag laravel8 .
docker run -v $PWD/app:/app -w /app -it --rm --name=Laravel8 alpine
#run alpine with cli mode inside container. Tip: create database at /app directory.
#make composer commands to install laravel8 or other framework. Good Luck.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment