在我的docker构建期间,我似乎无法进行迁移。
我试过了
泊坞窗,compose.yml
version: '3'
services:
portalmodules:
build:
context: .
dockerfile: Dockerfile
ports:
- 8011:8000
links:
- database
database:
image: postgres:11.2
ports:
- "5432:5432"
expose:
- "5432"
environment:
- "POSTGRES_PASSWORD=12345"
- "POSTGRES_USER=john"
- "POSTGRES_DB=api"
Dockerfile
FROM composer:1.8.5 as build_stage
COPY . /src
WORKDIR /src
RUN composer install
FROM alpine:3.8
RUN apk --no-cache add \
php7 \
php7-mbstring \
php7-session \
php7-openssl \
php7-tokenizer \
php7-json \
php7-pdo \
php7-pdo_pgsql \
php7-pgsql
COPY --from=build_stage /src /src
RUN ls -al
RUN set -x \
addgroup -g 82 -S www-data \
adduser -u 82 -D -S -G www-data www-data
WORKDIR /src
RUN ls -al
RUN chmod -R 777 storage
RUN chmod +x run.sh
RUN cp run.sh /tmp
ENTRYPOINT ["/tmp/run.sh"]
润.是
#!/bin/sh
php artisan migrate:fresh --seed
php artisan serve --host=0.0.0.0
.ENV
APP_NAME=API
APP_ENV=local
APP_KEY=base64:Qa3U2oP5IQ93MGEJu61MrcQFRSsS5vQRWUrqYwIplEo=
APP_DEBUG=true
APP_URL=http://1.1.1.1
#---------------------------------------------- DATABASE
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=api
DB_USERNAME=john
DB_PASSWORD=12345
我尝试了3种不同的值qazxsw poi qazxsw poi,qazxsw poi,DB_HOST
我不断得到
localhost
如何进行并进一步调试?