Last active
January 27, 2020 21:20
-
-
Save leequixxx/5eed98d965daa232cee7d55fc95c4952 to your computer and use it in GitHub Desktop.
Symfony dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.3.14-fpm-alpine3.11 | |
LABEL maintainer="mail@leequixxx.space" | |
RUN apk add --update libzip-dev curl-dev icu-dev postgresql-dev && \ | |
docker-php-ext-install curl zip intl pdo pdo_pgsql && \ | |
apk del gcc g++ && \ | |
rm -rf /var/cache/apk/* | |
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ | |
php -r "if (hash_file('sha384', 'composer-setup.php') === 'c5b9b6d368201a9db6f74e2611495f369991b72d9c8cbd3ffbc63edff210eb73d46ffbfce88669ad33695ef77dc76976') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ | |
php composer-setup.php --filename composer && \ | |
mv composer /usr/bin/composer && \ | |
php -r "unlink('composer-setup.php');" | |
ARG ROOT_DIRECTORY=/app | |
WORKDIR $ROOT_DIRECTORY | |
# Composer | |
COPY ./composer.json $ROOT_DIRECTORY/composer.json | |
COPY ./composer.lock $ROOT_DIRECTORY/composer.lock | |
RUN composer install | |
# NPM | |
COPY ./package.json $ROOT_DIRECTORY/package.json | |
COPY ./yarn.lock $ROOT_DIRECTORY/yarn.lock | |
# Webpack Encore | |
COPY ./assets $ROOT_DIRECTORY/assets | |
COPY .env* $ROOT_DIRECTORY/ | |
COPY ./webpack.config.js $ROOT_DIRECTORY/webpack.config.js | |
RUN apk --update add nodejs npm && \ | |
npm install && \ | |
npm run build && \ | |
apk del nodejs npm && \ | |
rm -rf /var/cache/apk/* | |
COPY ./ $ROOT_DIRECTORY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment