Skip to content

Commit e35b7af

Browse files
committed
Adding docker-compose environment
1 parent ddabff2 commit e35b7af

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

docker-compose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: "3.8"
2+
services:
3+
workspace:
4+
tty: true
5+
build:
6+
context: resources/docker/workspace
7+
args:
8+
PUID: "${PUID:-1000}"
9+
PGID: "${PGID:-1000}"
10+
volumes:
11+
- .:/var/www/html
12+
- ~/.composer:/home/user/.composer
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM php:7.2-cli-alpine
2+
3+
ARG PUID=1000
4+
ARG PGID=1000
5+
6+
RUN apk add --no-cache --virtual .build-deps \
7+
# for extensions
8+
$PHPIZE_DEPS \
9+
# for soap
10+
libxml2-dev \
11+
&& \
12+
apk add --no-cache \
13+
bash \
14+
# for soap
15+
libxml2 \
16+
# for composer
17+
unzip \
18+
&& \
19+
docker-php-ext-install soap \
20+
&& \
21+
pecl install \
22+
# pcov for coverage runs
23+
pcov && docker-php-ext-enable pcov \
24+
&& \
25+
apk del .build-deps
26+
27+
COPY --from=composer /usr/bin/composer /usr/bin/composer
28+
29+
WORKDIR /var/www/html
30+
31+
# Add a non-root user to prevent files being created with root permissions on host machine.
32+
RUN addgroup -g ${PGID} user && \
33+
adduser -u ${PUID} -G user -D user
34+
35+
USER user

0 commit comments

Comments
 (0)