-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-ci
More file actions
88 lines (74 loc) · 2.38 KB
/
Dockerfile-ci
File metadata and controls
88 lines (74 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
FROM php:7.2.9-apache
# user guid for the base container
# https://github.com/docker-library/docs/blob/master/php/README.md
MAINTAINER Name<email>
WORKDIR /var/www/html
# install required programs
RUN apt-get update && apt-get install -y \
sudo \
wait-for-it \
curl \
vim \
git\
# install php extensions
libmcrypt-dev \
zlib1g-dev \
sqlite3 \
libsqlite3-dev \
libssh2-1 \
libssh2-1-dev \
sshpass \
&& pecl install ssh2-1.1.2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# php packages
RUN docker-php-ext-install \
mbstring \
tokenizer \
zip \
mysqli \
pdo_mysql
RUN docker-php-ext-enable ssh2
# Enable rewrite module
RUN a2enmod rewrite
# Install PECL extensions
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
RUN echo 'xdebug.remote_port=9000' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.remote_connect_back=1' >> /usr/local/etc/php/php.ini
# create ssh keys
RUN mkdir -p /home/www-data/.ssh
RUN chown www-data:www-data -R /home/www-data
RUN chmod g+r -R /home/www-data
COPY docker/dev/deploy-target/.ssh/id_rsa /home/www-data/.ssh/id_rsa
RUN chmod go-wrx /home/www-data/.ssh/id_rsa
RUN chown www-data:www-data /home/www-data/.ssh/id_rsa
RUN ssh-keygen -y -f /home/www-data/.ssh//id_rsa > /home/www-data/.ssh/id_rsa.pub
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Manually set up the apache environment variables
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
#ONBUILD RUN composer install
#ONBUILD RUN composer install \
# --prefer-dist \
# --optimize-autoloader \
# --no-scripts \
# --no-dev \
# --profile \
# --ignore-platform-reqs \
# -vvv
# add a user that will be the same as my user so dosnt cause permission issues
#RUN useradd -m -u 1000 -s /bin/bash docker
#RUN echo docker:password | chpasswd
#RUN usermod -a -G sudo docker
#RUN usermod -a -G www-data docker
#RUN usermod -a -G docker www-data
COPY . /var/www/html
COPY docker/dev/.env /var/www/html/.env
COPY docker/dev/. /code
COPY docker/dev/apache-config.conf /etc/apache2/sites-enabled/000-default.conf
# prepare laravel for use
CMD wait-for-it version_deployment_db:3306 -- /code/setup_test_laravel.sh && sleep infinity