diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..ec71e2c1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "dockerComposeFile": "../docker-compose.yml", + "service": "builder", + "workspaceFolder": "/mozart/", + "shutdownAction": "stopCompose" +} diff --git a/Dockerfile b/Dockerfile index 122bb514..c9073b9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM composer:2.7.7 - FROM php:8.3.9-cli-alpine AS base FROM base as builder @@ -7,11 +6,15 @@ RUN apk update && apk add git COPY --from=composer /usr/bin/composer /usr/bin/composer COPY ./composer.json /mozart/ WORKDIR /mozart/ +RUN composer install + +FROM builder as packager +RUN rm -rf vendor RUN composer install --no-dev -o FROM base AS application RUN mkdir project WORKDIR /project/ -COPY --from=builder /mozart/ /mozart/ +COPY --from=packager /mozart/ /mozart/ COPY ./bin/ /mozart/bin/ COPY ./src/ /mozart/src/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..1def9525 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.4' +services: + builder: + build: + context: . + dockerfile: Dockerfile + target: builder + volumes: + - .:/mozart/ + command: /bin/sh -c "while sleep 1000; do :; done"