From 4ab2cb28f6b9c5aeb5748acdaa6c037015df1a86 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Sun, 21 Nov 2021 15:22:09 +0100 Subject: [PATCH 1/2] [fix] Fixed image building config. [add] Drone CI build and publish processes. --- .drone.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 4 ++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..6f45bbd --- /dev/null +++ b/.drone.yml @@ -0,0 +1,45 @@ +--- +kind: pipeline +type: docker +name: Build + +steps: +- name: build + image: plugins/docker + commands: + - sleep 5 + - docker build -t docker.pbiernat.dev/nginx-php . + - docker images | grep nginx-php + volumes: + - name: docker-sock + path: /var/run + +- name: publish + image: plugins/docker + environment: + DOCKER_USERNAME: + from_secret: registry_username + DOCKER_PASSWORD: + from_secret: registry_password + commands: + - sleep 5 + - docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + - docker push docker.pbiernat.dev/nginx-php + when: + branch: master + volumes: + - name: docker-sock + path: /var/run + +services: +- name: docker + image: docker:dind + privileged: true + volumes: + - name: docker-sock + path: /var/run + +volumes: +- name: docker-sock + temp: {} + diff --git a/Dockerfile b/Dockerfile index 710eefd..45b9f61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest -RUN apk add --update --no-cache coreutils supervisor acl nginx make curl bash \ - && mkdir /run/nginx && mkdir /var/www/app && mkdir /run/php +RUN apk add --update --no-cache coreutils supervisor acl nginx make curl bash icu-libs \ + && mkdir -p /run/nginx && mkdir /var/www/app && mkdir /run/php RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \ php7 php7-fpm php7-opcache php7-mysqli php7-json php7-openssl php7-curl php7-zlib composer \ From cafd520a6c3adcfe505b559f99ca2307e67fe864 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Tue, 23 Nov 2021 00:28:30 +0100 Subject: [PATCH 2/2] [fix] Added sample test wwwroot and fixed default nginx conf --- .gitignore | 4 +++- src/etc/nginx/conf.d/default.conf | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c138f46..7495efa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.history/ \ No newline at end of file +.history/ + +/test diff --git a/src/etc/nginx/conf.d/default.conf b/src/etc/nginx/conf.d/default.conf index 75340f0..76e5402 100644 --- a/src/etc/nginx/conf.d/default.conf +++ b/src/etc/nginx/conf.d/default.conf @@ -1,6 +1,3 @@ -# This is a default site configuration which will simply return 404, preventing -# chance access to any other virtualhost. - server { listen 80 default_server; listen [::]:80 default_server; @@ -43,4 +40,5 @@ server { error_log /var/log/nginx/app_error.log; access_log /var/log/nginx/app_access.log; -} \ No newline at end of file +} +