Skip to content

Commit

Permalink
#37 feat: config docker for worker
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Aug 3, 2024
1 parent c347c65 commit f320a4a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,17 @@ services:
interval: 30s
timeout: 10s
retries: 5

worker:
container_name: "${COMPOSE_PROJECT_NAME}-worker"
build:
context: worker
args:
- TZ=${TZ}
- USER_ID=${USER_ID}
- GROUP_ID=${GROUP_ID}
networks:
- cslant_blog
volumes:
- ${SOURCE_CODE_PATH}:/var/dev
- ./worker/supervisor.d:/etc/supervisor.d
26 changes: 26 additions & 0 deletions worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM php:8.3-cli-alpine

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

ARG USER_ID=1000
ENV USER_ID ${USER_ID}
ARG GROUP_ID=1000
ENV GROUP_ID ${GROUP_ID}

RUN set -eu; \
addgroup -g ${USER_ID} csdev; \
adduser -D -u ${USER_ID} -G csdev csdev

ADD blog.php.ini "$PHP_INI_DIR/conf.d/blog.ini"

WORKDIR /var/dev

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN install-php-extensions soap pcntl bcmath gd exif sockets zip xdebug redis intl pdo_pgsql pgsql mysqli

## Install supervisord
RUN apk add --no-cache supervisor

ADD supervisord.conf /etc/supervisord.conf

CMD ["supervisord", "-c", "/etc/supervisord.conf", "-n"]

0 comments on commit f320a4a

Please sign in to comment.