Skip to content

Commit b1cca1e

Browse files
committed
implemented go in the docker file
1 parent 08586ce commit b1cca1e

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

Dockerfile

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
1-
ARG PHP_VERSION
1+
ARG PHP_VERSION=8.4.7
22

33
FROM php:${PHP_VERSION}-cli
4+
5+
# Set environment variables
6+
ENV PATH="/usr/local/go/bin:${PATH}" \
7+
COMPOSER_ALLOW_SUPERUSER=1 \
8+
DEBIAN_FRONTEND=noninteractive
9+
10+
# Install dependencies, Go, PHP extensions, and tools
411
RUN apt-get update \
5-
&& apt-get install -y \
12+
&& apt-get install -y --no-install-recommends \
613
libzip-dev \
714
unzip \
815
git \
916
wget \
17+
curl \
18+
tar \
19+
gcc \
20+
make \
21+
ca-certificates \
22+
build-essential \
23+
pkg-config \
24+
software-properties-common \
25+
# Install Go 1.22.0
26+
&& curl -LO https://golang.org/dl/go1.22.0.linux-amd64.tar.gz \
27+
&& tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz \
28+
&& rm go1.22.0.linux-amd64.tar.gz \
29+
&& ln -s /usr/local/go/bin/go /usr/bin/go \
30+
# Install PHP extensions
1031
&& docker-php-ext-install -j$(nproc) bcmath sockets \
11-
&& wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
12-
&& mv test-reporter-latest-linux-amd64 /usr/bin/cc-test-reporter \
32+
# Install CodeClimate Test Reporter
33+
&& wget -O /usr/bin/cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
1334
&& chmod +x /usr/bin/cc-test-reporter \
35+
# Install and enable Xdebug
1436
&& pecl install xdebug \
15-
&& docker-php-ext-enable xdebug && \
16-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
37+
&& docker-php-ext-enable xdebug \
38+
# Install Composer
39+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
40+
# Cleanup
41+
&& apt-get clean \
42+
&& rm -rf /var/lib/apt/lists/*
1743

44+
# Set working directory
1845
WORKDIR /opt/project
19-
20-
21-

docker-compose.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ x-definitions:
3030
PHP_VERSION: "${PHP_VERSION-8.1}"
3131
volumes:
3232
- .:/opt/project
33+
3334
x-common-cluster:
3435
&common-cluster
3536
<<: *common
@@ -51,6 +52,7 @@ services:
5152
- .:/opt/project
5253
env_file:
5354
- .env
55+
5456
neo4j:
5557
<<: *common
5658
image: neo4j:5-enterprise
@@ -66,7 +68,6 @@ services:
6668
NEO4J_server_bolt_advertised__address: neo4j:7687
6769
NEO4J_server_http_advertised__address: neo4j:7474
6870

69-
7071
server1:
7172
<<: *common-cluster
7273
hostname: server1
@@ -117,9 +118,7 @@ services:
117118
NEO4J_server_http_advertised__address: server4:7474
118119

119120
testkit:
120-
image: python:3.13
121-
volumes:
122-
- .:/opt/project
121+
<<: *common-php
123122
working_dir: /opt/project/testkit-backend
124123
networks:
125124
- neo4j

0 commit comments

Comments
 (0)