Skip to content

Instantly share code, notes, and snippets.

@MrMohebi
Created April 11, 2022 08:46
Show Gist options
  • Save MrMohebi/7e4b15acc28de3a7c5b8a7b46f45a4fa to your computer and use it in GitHub Desktop.
Save MrMohebi/7e4b15acc28de3a7c5b8a7b46f45a4fa to your computer and use it in GitHub Desktop.
TEST DOCKER FILE
version: '3.8'
services:
main-api:
build:
context: ./
dockerfile: Dockerfile-api
container_name: "main-api"
restart: always
FROM php:8.0
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN apt-get update -y && apt-get upgrade -y && apt-get install git libssl-dev -y
# Install unzip utility and libs needed by zip PHP extension
RUN apt-get update && apt-get install -y \
zlib1g-dev \
libzip-dev \
unzip
RUN docker-php-ext-install zip
RUN pecl install mongodb && docker-php-ext-enable mongodb
#RUN echo "extension=mongodb.so" >> /usr/local/etc/php/php.ini
#COPY --from=composer /usr/bin/composer /usr/bin/composer
#RUN apt-get install php-mongodb
WORKDIR /api
COPY ./mainApi ./
# proxy
RUN apt-get install -y netcat
RUN mkdir -p ~/.ssh/
RUN touch ~/.ssh/config
RUN echo 'Host gitlab.com' >> ~/.ssh/config
RUN echo 'ProxyCommand nc -X connect -x fodev.org:8118 %h %p' >> ~/.ssh/config
RUN git config --global http.proxy fodev.org:8118
# RUN cd /api && composer update --prefer-dist && composer dump-autoload
RUN php artisan optimize:clear
RUN php artisan key:generate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment