Skip to content

Commit

Permalink
Dockerized development (#1288)
Browse files Browse the repository at this point in the history
* Add dockerfile and docker-compose for development purpose
  • Loading branch information
SQKo authored Jan 27, 2025
1 parent 2e8f09b commit cb6299f
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# general
.env
.DS_Store
.idea
.phplint-cache
dump.html
.vscode
.github
.editorconfig
.dockerignore
Dockerfile
docker-compose.yml
/.git

# phive
/tools
.phive

# composer
/vendor
composer.lock

# docs
/build
.phpdoc
/docs
/guide

# php-cs-fixer
.php_cs.cache
.php_cs
.php-cs-fixer.php
.php-cs-fixer.cache

# phpunit
phpunit.log
/.phpunit*
/coverage
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM php:8.1-cli-alpine

RUN apk add --update linux-headers \
&& apk --no-cache add pcre ${PHPIZE_DEPS} \
&& pecl install xdebug-3.3.2 \
&& docker-php-ext-enable xdebug \
&& apk del pcre ${PHPIZE_DEPS}

# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

ENV BOTDIR="/root/discord-php"
ENV BOTSCRIPT="./bot.php"
LABEL version="10"
WORKDIR ${BOTDIR}
COPY . ${BOTDIR}

COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN composer install --no-cache --no-interaction

CMD php ${BOTSCRIPT}
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
bot:
build: .
volumes:
- .:/root/discord-php
volumes:
bot:
driver: local

0 comments on commit cb6299f

Please sign in to comment.