Skip to content

Commit

Permalink
config(docker)
Browse files Browse the repository at this point in the history
  • Loading branch information
domi41 committed May 8, 2022
1 parent 1bfe677 commit ead1d19
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 52 deletions.
52 changes: 5 additions & 47 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,60 +23,15 @@ RUN apk add --no-cache \
ARG APCU_VERSION=5.1.18


#RUN apk add --update \
# autoconf \
# g++ \
# libtool \
# make \
# icu-dev \
# libzip-dev \
# zlib-dev \
# freetype-dev \
# libpng-dev \
# libjpeg-turbo-dev \
# libxml2-dev \
# imagemagick \
# imagemagick-dev \
# oniguruma-dev \
# && docker-php-ext-configure gd \
## --with-gd \
## --with-freetype-dir=/usr/include/ \
## --with-png-dir=/usr/include/ \
## --with-jpeg-dir=/usr/include/ \
# && docker-php-ext-configure zip \
# && docker-php-ext-install \
# gd \
# mbstring \
# mysqli \
# opcache \
# soap \
# intl \
# zip \
# pdo_mysql \
# && pecl install apcu-${APCU_VERSION} \
# && pecl install imagick \
# && docker-php-ext-enable \
# apcu \
# imagick \
# opcache \
# && apk del autoconf g++ libtool make \
# && rm -rf /tmp/* /var/cache/apk/*

RUN set -eux; \
apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
# icu-dev \
# libzip-dev \
# zlib-dev \
# imagemagick \
# imagemagick-dev \
autoconf \
g++ \
libtool \
make \
icu-dev \
libzip-dev \
zlib-dev \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
Expand All @@ -101,6 +56,7 @@ RUN set -eux; \
php7-pcntl \
php7-zip \
# sqlite \
zlib-dev \
; \
\
docker-php-ext-configure zip; \
Expand Down Expand Up @@ -136,7 +92,8 @@ RUN set -eux; \
)"; \
apk add --no-cache --virtual .phpexts-rundeps $runDeps; \
\
apk del .build-deps
apk del .build-deps; \
rm -rf /tmp/* /var/cache/apk/*

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

Expand Down Expand Up @@ -171,15 +128,16 @@ ENV STABILITY ${STABILITY:-stable}
ARG SYMFONY_VERSION="4"

# Download the Symfony skeleton and leverage Docker cache layers
# This is clever ; let's try to prepare as much as we can before the COPY.
#RUN composer create-project "symfony/skeleton ${SYMFONY_VERSION}" \
# . \
# --stability=$STABILITY --prefer-dist --no-dev --no-progress --no-scripts --no-interaction; \
# But… Why would one want to clear the cache at this point?
# composer clear-cache

# Copy the project files into the image
COPY . .


# Re-enable the --no-dev once we don't need to debug prod.
# (the lies we tell ourselves…)
RUN composer install \
Expand Down
14 changes: 9 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version: "3.4"

# docker-compose up --build
# docker-compose down

services:
php:
container_name: oas
Expand All @@ -10,7 +13,7 @@ services:
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
STABILITY: ${STABILITY:-stable}
healthcheck:
interval: 600s
interval: 3600s
timeout: 20s
retries: 3
start_period: 30s
Expand Down Expand Up @@ -62,10 +65,11 @@ services:
# You should definitely change the password in production
- MYSQL_PASSWORD=${MVOAS_MYSQL_PASSWORD:-limaju}
- MYSQL_RANDOM_ROOT_PASSWORD=true
volumes:
- ./var/db/data:/var/lib/mysql:rw
ports:
- 3308
# If we need this, let's mount it somewhere other than ./var (conflicts with symfony)
#volumes:
# - ./var/db/data:/var/lib/mysql:rw
#ports:
# - "3308:3306"



0 comments on commit ead1d19

Please sign in to comment.