Skip to content

Commit

Permalink
Add initial Docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
amenk committed Dec 28, 2023
1 parent 42e4df1 commit ebfead7
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dockerfile
vendor/
.git
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM composer:2.6.6 as composer

FROM php:8.1-apache-buster

RUN apt-get update && apt-get install -y zip

RUN apt-get -y update \
&& apt-get install -y libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl

RUN apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
zlib1g-dev && \
docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg \
--with-xpm --with-freetype && \
docker-php-ext-install gd

RUN a2enmod rewrite

RUN curl https://robo.li/robo.phar -o /usr/bin/robo && chmod +x /usr/bin/robo

ENV LOG_CHANNEL=stderr

RUN sed -ri -e 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!/var/www/html/public!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

RUN sed -ri -e 's!^</!<Directory "/var/www/html/public">\nAllowOverride all\n</Directory>\n</!g' /etc/apache2/sites-available/*.conf

COPY . /var/www/html
RUN chown -R www-data:www-data /var/www/html/storage || true
RUN chown -R www-data:www-data /var/www/html/bootstrap/cache || true

COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN composer install --no-dev
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.9"
services:
opg-pages:
image: opg-pages
environment:
- APP_KEY
- APP_URL=http://localhost:3000/
- ASSET_URL=http://localhost:3000/

web:
image: osmapp
ports:
- "3000:3000"

0 comments on commit ebfead7

Please sign in to comment.