Skip to content

Commit

Permalink
fix: fixing build files
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnyjohnti committed Sep 9, 2024
1 parent 54e812f commit 261c744
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
!app/
!bin/
!config/
!migrations/
!seeders/
!composer.*
.docker/
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ APP_ENV=dev
DB_DRIVER=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=hyperf
DB_USERNAME=root
DB_PASSWORD=
DB_DATABASE=quotadb
DB_USERNAME=quotauser
DB_PASSWORD=quotapass
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
DB_PREFIX=
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ ENV TIMEZONE=${timezone:-"Asia/Shanghai"} \
SCAN_CACHEABLE=(true)

# update
RUN set -ex \
RUN apk update \
&& apk add --no-cache postgresql-dev \
php83-pdo_pgsql \
php83-pgsql \
&& rm -rf /var/cache/apk/* \
&& set -ex \
# show php version and extensions
&& php -v \
&& php -m \
Expand Down Expand Up @@ -47,7 +52,7 @@ WORKDIR /opt/www
# RUN composer install --no-dev --no-scripts

COPY . /opt/www
RUN print "\n" | composer install -o && php bin/hyperf.php
RUN print "\n" | composer install -o && composer update && php bin/hyperf.php && php bin/hyperf.php gen:swagger

EXPOSE 9501

Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ RUN apk update \
php83-pdo_pgsql \
php83-pgsql \
&& rm -rf /var/cache/apk/* \
# && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
# && docker-php-ext-install pgsql pdo_pgsql \
&& set -ex \
# show php version and extensions
&& php -v \
Expand Down Expand Up @@ -54,7 +52,7 @@ WORKDIR /opt/www
# RUN composer install --no-dev --no-scripts

COPY . /opt/www
RUN composer install --no-dev -o && php bin/hyperf.php
RUN composer install --no-dev -o && composer update && php bin/hyperf.php && php bin/hyperf.php gen:swagger

EXPOSE 9501

Expand Down
21 changes: 12 additions & 9 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ services:
container_name: quota-service
# image: hyperf/hyperf:8.3-alpine-v3.19-swoole-slim
build:
context: .
dockerfile: ./Dockerfile
working_dir: /app
entrypoint: [ "php", "bin/hyperf.php", "server:watch" ]
volumes:
- ./:/app
# Development params
# working_dir: /opt/www
# entrypoint: [ "php", "bin/hyperf.php", "server:watch" ]
# volumes:
# - ./:/opt/www
ports:
- '9501:9501'
environment:
Expand Down Expand Up @@ -46,11 +48,12 @@ services:

volumes:
quota-db:
driver: local
driver_opts:
o: bind
type: none
device: ./.docker/quota-db
# Development params
# driver: local
# driver_opts:
# o: bind
# type: none
# device: ./.docker/quota-db

networks:
lab:
Expand Down

0 comments on commit 261c744

Please sign in to comment.