Skip to content

Commit

Permalink
Merge pull request #148 from coenjacobs/devcontainer-implementation
Browse files Browse the repository at this point in the history
Devcontainer implementation
  • Loading branch information
coenjacobs authored Jul 22, 2024
2 parents acfe1de + 9680ef3 commit 2fb827d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dockerComposeFile": "../docker-compose.yml",
"service": "builder",
"workspaceFolder": "/mozart/",
"shutdownAction": "stopCompose"
}
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM composer:2.7.7

FROM php:8.3.9-cli-alpine AS base

FROM base as builder
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/
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 2fb827d

Please sign in to comment.