Skip to content

Commit

Permalink
fpm api
Browse files Browse the repository at this point in the history
  • Loading branch information
petertgiles committed Jun 11, 2024
1 parent 72ae8ce commit b7cd3e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 32 deletions.
47 changes: 16 additions & 31 deletions api/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
# based on https://github.com/laravel/sail/blob/1.x/runtimes/8.2/Dockerfile
FROM mcr.microsoft.com/appsvc/php:8.2-fpm-xdebug_20230908.3.tuxprod

FROM ubuntu:22.04

WORKDIR /var/www/html

ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update \
&& mkdir -p /etc/apt/keyrings \
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch ffmpeg nano \
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
&& apt-get update \
&& apt-get install -y php8.2-cli php8.2-dev \
php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick \
php8.2-curl \
php8.2-imap php8.2-mysql php8.2-mbstring \
php8.2-xml php8.2-zip php8.2-bcmath php8.2-soap \
php8.2-intl php8.2-readline \
php8.2-ldap \
php8.2-msgpack php8.2-igbinary php8.2-redis php8.2-swoole \
php8.2-memcached php8.2-pcov php8.2-xdebug \
&& apt-get install -y postgresql-client \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

CMD /usr/bin/php /var/www/html/artisan serve --host=0.0.0.0 --port=8001
# once we upgrade to buildkit we can use heredocs: https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/
RUN printf ' \n\
server { \n\
listen 8001; \n\
root /home/site/wwwroot; \n\
index index.php \n\
server_name localhost; \n\
port_in_redirect off; \n\
\n\
location ~* { \n\
fastcgi_pass 127.0.0.1:9000; \n\
include fastcgi_params; \n\
fastcgi_param SCRIPT_FILENAME $document_root/public/index.php; \n\
} \n\
} ' > /etc/nginx/sites-available/default
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
context: ./api
dockerfile: dev.Dockerfile
volumes:
- ./api:/var/www/html
- ./api:/home/site/wwwroot
ports:
- "8001:8001"

Expand Down

0 comments on commit b7cd3e2

Please sign in to comment.