Skip to content

Commit d4da3ed

Browse files
committed
feat: add docker to project
1 parent 48d0cd2 commit d4da3ed

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git
2+
vendor

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM php:8.1-cli
2+
3+
# unzip and git are needed for composer to run
4+
RUN apt-get update && apt-get install -y \
5+
unzip \
6+
git \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
# Install Composer binary
10+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
11+
12+
WORKDIR /app
13+
14+
# Copy composer files first for better cache usage
15+
COPY composer.json composer.lock* ./
16+
17+
# Install all the dependencies and clear cache
18+
RUN composer install --no-interaction --prefer-dist --no-progress && \
19+
composer clear-cache
20+
21+
# Copy the rest of the application
22+
COPY . .
23+
24+
ENTRYPOINT [ "bash" ]

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: php-serhii-ago
2+
3+
services:
4+
app:
5+
build:
6+
context: .
7+
image: php-serhii-ago
8+
volumes:
9+
- .:/app
10+
environment:
11+
- TERM=xterm-256color
12+
tty: true
13+
stdin_open: true

0 commit comments

Comments
 (0)