forked from dbarzin/mercator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dbarzin#357 from dbarzin/master
Rebase
- Loading branch information
Showing
171 changed files
with
13,310 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
.git | ||
docker/data | ||
*Dockerfile | ||
*.md | ||
.dockerignore | ||
.env* | ||
*.sqlite* | ||
nginx.conf | ||
supervisord.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Test naming | ||
run: echo "ghcr.io/${{ github.repository }}:latest" | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,61 @@ | ||
# ubuntu / jammy (22.04-LTS) | ||
FROM ubuntu:jammy | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
RUN set -x ; \ | ||
apt update ; apt upgrade ; \ | ||
apt install -y --no-install-recommends \ | ||
ssmtp \ | ||
mailutils \ | ||
php php-zip \ | ||
php-curl \ | ||
php-mbstring \ | ||
php-dom php-ldap \ | ||
php-soap \ | ||
php-xdebug \ | ||
php-mysql \ | ||
php-gd \ | ||
php-xdebug \ | ||
php-mysql \ | ||
php-gd \ | ||
graphviz \ | ||
curl less ca-certificates netcat-traditional ; \ | ||
apt-get autoremove --yes ; rm -fr /var/cache/apt | ||
|
||
# install composer | ||
RUN set -x ; \ | ||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
WORKDIR /var/www/mercator | ||
FROM php:8.2-fpm-alpine3.16 | ||
|
||
# apparently you cannot pass both env variables | ||
# and .env file | ||
ENV DB_CONNECTION=sqlite | ||
ENV DB_DATABASE=/var/www/mercator/db.sqlite | ||
|
||
# system deps | ||
RUN apk update && apk add curl nano bash ssmtp graphviz ca-certificates sqlite sqlite-dev postgresql12 postgresql12-dev nginx supervisor | ||
|
||
# php deps | ||
RUN apk add php8-zip \ | ||
php8-curl \ | ||
php8-mbstring \ | ||
php8-dom php8-ldap \ | ||
php8-soap \ | ||
php8-xdebug \ | ||
php8-mysqli \ | ||
php8-sqlite3 \ | ||
php8-pgsql \ | ||
php8-gd \ | ||
php8-xdebug \ | ||
php8-gd \ | ||
php8-pdo php8-pdo_sqlite php8-pdo_mysql php8-pdo_pgsql \ | ||
php8-fileinfo \ | ||
php8-simplexml php8-xml php8-xmlreader php8-xmlwriter \ | ||
php8-tokenizer \ | ||
composer | ||
|
||
RUN docker-php-ext-install pgsql pdo_pgsql | ||
|
||
# sources | ||
COPY . /var/www/mercator | ||
WORKDIR /var/www/mercator | ||
|
||
# the sqlite file must exist | ||
# RUN touch ${DB_DATABASE} | ||
|
||
|
||
# USER www:www | ||
# RUN set -x ; \ | ||
# groupadd www ; \ | ||
# useradd -g www -ms /bin/bash www ; \ | ||
# chown -R www:www /var/www ; \ | ||
# add mercator:www user | ||
RUN addgroup -S www && \ | ||
adduser -S mercator -G www && \ | ||
chown -R mercator:www /var/www /var/lib/nginx /var/log/nginx | ||
|
||
# COPY nginx.conf /etc/nginx/http.d/mercator.conf | ||
# RUN chown -R mercator:www | ||
|
||
# install mercator dependancies | ||
RUN set -x ; \ | ||
cd /var/www/mercator ; composer install | ||
RUN cp docker/nginx.conf /etc/nginx/http.d/mercator.conf | ||
RUN cp docker/supervisord.conf /etc/supervisord.conf | ||
|
||
USER mercator:www | ||
|
||
# install mercator deps | ||
RUN composer install | ||
|
||
EXPOSE 8000 | ||
ENTRYPOINT /var/www/mercator/docker/entrypoint.sh | ||
|
||
|
||
CMD ["/usr/bin/supervisord"] | ||
|
||
# APP_KEY="${APP_KEY:-base64:$(head -c 32 /dev/urandom|base64)}" php artisan serve --host=0.0.0.0 --port=8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.