Public Repository

Last pushed: 20 days ago
Short Description
Short description is empty for this repo.
Full Description

SmartCloud-Containers

Some reusable containers for the SmartCloud Project.

nginxsf

Generic nginx container including default.conf to use with PHP/FPM in different container.
The PHP app should be mounted or copied into the container unter /app (docroot is /app/web).
Nginx will start and connect to a fastcgi service as given in the ENV var FPMSERVICE.

In order to allow for ENV vars to be used in configuration, all config files in /etc/nginx/conf.d
ending with .tmpl will be parsed and all occurrences of ${VARNAME} will be replaced by the corresponding ENV var.
This is not done with the standard way recommended by nginx website, because this will also remove all occurrences
of $varname in the template files. Instead the entrypoint has a simple shell script that does the replace and changed
the names of the files to remove the .tmpl during container start before CMD is invoked.

Therefore additional .tmpl-files copied or mounted into the container will be translated also.

The container can be invoked like this:

services:
    sc_3rdparty_app_web:
        image: digitalrepublic/nginxsf
        ports:
            - "9090:80"
        volumes:
            - ".:/app"
        depends_on:
            - "sc_3rdparty_app_fpm"
        environment:
            FPMSERVICE: "sc_3rdparty_app_fpm:9000"

phpdev

PHP Development container. This one has PHP 7-cli, composer and some libraries needed to build and work with the php application. It does not contain fpm or webserver, is not intended to run in production.

Composer is installed in /home/dev/composer. The user dev has user-id 1000 and should be used for every action that generates files.

The container can be configured like this:

   build:
        image: digitalrepublic/phpdev
        volumes:
            - ".:/mnt/application"
            - "~/.ssh:/home/dev/.ssh"
            - "~/.composer:/home/dev/.composer"

Then, the started container can be used like this:

docker-compose run --rm -u dev build /home/dev/composer install

jsdev

This container is meant as a dev env for nodeJS and Frontend Development. It contains npmm, yarn and a js toolchain.

The user dev has user-id 1000 and should be used for every action that generates files.

Contributing

The Dockerfiles can be edited and committed as usual. To build and tag the container call:

make build_phpdev
or
make build_nxinxsf
or
make build_jsdev

To push the containers to dockerhub, call:

make push_phpdev
or
make push_nxinxsf
or
make push_jsdev

To build and push all containers, do:

make push
Docker Pull Command
Owner
digitalrepublic

Comments (0)