AWS EC2 User Data create SH script - amazon-web-services

I'm creating a new instance in AWS and adding some user data, but part of the job is to create an sh file and then executed.
I'm trying:
#!/bin/bash -x
cd /tmp
INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
sudo wget -O ethminer.tar.gz https://github.com/ethereum-mining/ethminer/releases/download/v0.18.0/ethminer-0.18.0-cuda-9-linux-x86_64.tar.gz
sudo tar xvfz ethminer.tar.gz
cd bin
cat > runner.sh << __EOF__
#!/bin/bash -x
SERVERS=(us1 us2 eu1 asia1)
while (true); do
PREFERRED_SERVER=\${!SERVERS[\${!RANDOM} % \${!#SERVERS[#]}]}
./ethminer \
-P stratums://xxx.${!INSTANCE_ID}#\${!PREFERRED_SERVER}.ethermine.org:5555 \
-P stratums://xxx.${!INSTANCE_ID}#us1.ethermine.org:5555 \
-P stratums://xxx.${!INSTANCE_ID}#us2.ethermine.org:5555 \
-P stratums://xxx.${!INSTANCE_ID}#eu1.ethermine.org:5555 \
-P stratums://xxx.${!INSTANCE_ID}#asia1.ethermine.org:5555 \
>> /tmp/ethminer.log 2>&1
done
__EOF__
sudo chmod +x runner.sh
sudo nohup ./runner.sh &
Everything works except the sh, my command creates the runner.sh script but it is empty.

The UserData does not work because its is designed from CloudFormation, thus it has incorrect syntax for use in a standalone instance. The script with correct syntax is below and it will generate your runner.sh. I haven't tested runner's functionality, only the creation of the runner.sh.
#!/bin/bash -x
cd /tmp
INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
sudo wget -O ethminer.tar.gz https://github.com/ethereum-mining/ethminer/releases/download/v0.18.0/ethminer-0.18.0-cuda-9-linux-x86_64.tar.gz
sudo tar xvfz ethminer.tar.gz
cd bin
cat > runner.sh << __EOF__
#!/bin/bash -x
SERVERS=(us1 us2 eu1 asia1)
while (true); do
PREFERRED_SERVER=\${SERVERS[\${RANDOM} % \${#SERVERS[#]}]}
./ethminer \
-P stratums://xXX.${insTANCE_ID}#\${PREFERRED_SERVER}.ethermine.org:5555 \
-P stratums://xxx.${INSTANCE_ID}#us1.ethermine.org:5555 \
-P stratums://xxx.${INSTANCE_ID}#us2.ethermine.org:5555 \
-P stratums://xxx.${INSTANCE_ID}#eu1.ethermine.org:5555 \
-P stratums://xxx.${INSTANCE_ID}#asia1.ethermine.org:5555 \
>> /tmp/ethminer.log 2>&1
done
__EOF__
sudo chmod +x runner.sh
sudo nohup ./runner.sh &

Related

django and gurobi in docker have permission issues

I am trying to create a docker image for Django + Gurobi.
Container runs as root by default.
Gurobi does not want to run as root since license is issued to non-root user.
If switching to non-root, Django's python complains "attempt to write a read-only database" using /db.sqlite3.
chown+chmod just /apps, /db.sqlite3, and /usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3 did not help.
problem seems to go away if I chown and chmod 777 the entire container: bad idea
What is the solution? Below is the Dockerfile
FROM python:3.9
COPY . .
ADD data .
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV APP_USER=user32
ENV APP_HOME=/home/$APP_USER
# install python dependencies
RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --upgrade pip
RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --no-cache-dir -r requirements.txt
RUN apt-get update && apt-get install -y inetutils-ping
RUN tar xvzf gurobi9.5.0_linux64.tar.gz
ENV GUROBI_HOME /gurobi950/linux64
RUN cd /gurobi950/linux64 && python setup.py install
RUN rm gurobi9.5.0_linux64.tar.gz
RUN groupadd -r $APP_USER && \
useradd -r -g $APP_USER -d $APP_HOME -s /sbin/nologin -c "Docker image user" $APP_USER
ENV TZ 'America/Los_Angeles'
RUN echo $TZ > /etc/timezone && apt-get update && \
apt-get install -y tzdata && \
rm /etc/localtime && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
apt-get clean
#RUN chown -R $APP_USER:$APP_USER $APP_HOME
#RUN chown -R $APP_USER:$APP_USER /apps/
#RUN chown -R $APP_USER:$APP_USER /data/
#RUN chown -R $APP_USER:$APP_USER /gurobi950/
#RUN chown -R $APP_USER:$APP_USER /usr/local/lib/python3.9/
#RUN chown -R $APP_USER:$APP_USER /db.sqlite3
#RUN chmod -R 777 /db.sqlite3
#RUN chmod -R 777 /apps
#RUN chmod -R 777 /usr/local/lib/python3.9
#RUN chmod -R 777 /gurobi950
#RUN chown -R $APP_USER:$APP_USER /
#RUN chmod -R 777 /
ENV GRB_LICENSE_FILE /gurobi.lic
ENV LD_LIBRARY_PATH=/gurobi950/linux64/lib
RUN /gurobi950/linux64/bin/gurobi_cl --version
WORKDIR /
# running migrations
RUN python manage.py migrate
USER $APP_USER
# gunicorn
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]
Here's the error on navigating to the home page
Request Method: POST
Request URL: http://localhost/login/?next=/
Django Version: 3.2.6
Exception Type: OperationalError
Exception Value:
attempt to write a readonly database
Exception Location: /usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py, line 423, in execute
Python Executable: /usr/local/bin/python
Python Version: 3.9.9
Python Path:
['/',
'/usr/local/bin',
'/usr/local/lib/python39.zip',
'/usr/local/lib/python3.9',
'/usr/local/lib/python3.9/lib-dynload',
'/usr/local/lib/python3.9/site-packages',
'/usr/local/lib/python3.9/site-packages/IPython/extensions']
By default, commercial software like Gurobi does not let you run inside a Docker container. Please contact Gurobi support at https://support.gurobi.com to discuss alternatives.

Dockerfile PHP error build with "error php_intl.lo"

I'm building a PHP 7.4 container based on dunglas/symfony-docker but i've got this error during build :
/bin/sh /usr/src/php/ext/intl/libtool --mode=compile cc -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -DU_HIDE_OBSOLETE_UTF_OLD_H=1 -DU_DEFINE_FALSE_AND_TRUE=1 -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/usr/src/php/ext/intl -DPHP_ATOM_INC -I/usr/src/php/ext/intl/include -I/usr/src/php/ext/intl/main -I/usr/src/php/ext/intl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/intl/php_intl.c -o php_intl.lo
make: /bin/sh: Operation not permitted
make: *** [Makefile:192: php_intl.lo] Error 127
ERROR: Service 'php' failed to build: The command '/bin/sh -c set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS icu-dev libzip-dev zlib-dev ; docker-php-ext-configure zip; docker-php-ext-install -j$(nproc) intl zip ; pecl install apcu-${APCU_VERSION} ; pecl clear-cache; docker-php-ext-enable apcu opcache ; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache --virtual .phpexts-rundeps $runDeps;
It looks like permission error but i don't know how to fix it (and i'm not admin of my laptop).
Here's my dockerfile :
ARG PHP_VERSION=7.4
# "php" stage
FROM php:${PHP_VERSION}-fpm-alpine AS symfony_php
RUN apk add --no-cache \
acl \
fcgi \
file \
gettext \
git \
jq \
;
ARG APCU_VERSION=5.1.19
RUN set -eux; \
apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
icu-dev \
libzip-dev \
zlib-dev \
; \
\
docker-php-ext-configure zip; \
docker-php-ext-install -j$(nproc) \
intl \
zip \
; \
pecl install \
apcu-${APCU_VERSION} \
; \
pecl clear-cache; \
docker-php-ext-enable \
apcu \
opcache \
; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-cache --virtual .phpexts-rundeps $runDeps; \
\
apk del .build-deps
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
COPY docker/php7-fpm/conf.d/symfony.dev.ini $PHP_INI_DIR/conf.d/symfony.ini
RUN set -eux; \
{ \
echo '[www]'; \
echo 'ping.path = /ping'; \
} | tee /usr/local/etc/php-fpm.d/docker-healthcheck.conf
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
COPY docker/php7-fpm/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
RUN chmod +x /usr/local/bin/docker-healthcheck
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
COPY docker/php7-fpm/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]
And docker-compose.yml :
version: "3.4"
services:
# PHP
php:
build:
context: docker/php7-fpm
target: symfony_php
restart: unless-stopped
healthcheck:
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
container_name: dso_php
hostname: php
volumes:
- ./:/var/www/deep-space-objects:rw,cached
- ./docker/php7-fpm/conf.d/symfony.dev.ini:/usr/local/etc/php/conf.d/symfony.ini
OS and docker versions :
Docker version 19.03.12, build 48a66213fe
docker-compose version 1.29.0, build 07737305
Fedora release 30 (Thirty)
Thanks
Fixed with :
ARG PHP_VERSION=7.4
# "php" stage
FROM php:${PHP_VERSION}-fpm-alpine3.13 AS symfony_php
From this issue : https://github.com/docker-library/php/issues/1130

Docker Build Error: "gpg: keyserver receive failed: No name"

I'm trying build a docker container with the following command:
sudo docker build docker_calculadora/
but when it's building, at the step 9 it appears the following error:
Step 9/27 : RUN set -ex; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; command -v gpgconf > /dev/null && gpgconf --kill all || :; rm -r "$GNUPGHOME"; apt-key list
---> Running in a80677ab986c
mktemp -d
export GNUPGHOME=/tmp/tmp.TiWBSXwFOS
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 177F4010FE56CA3336300305F1656F24C74CD1D8
gpg: keybox '/tmp/tmp.TiWBSXwFOS/pubring.kbx' created
gpg: keyserver receive failed: No name
The command '/bin/sh -c set -ex; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; command -v gpgconf > /dev/null && gpgconf --kill all || :; rm -r "$GNUPGHOME"; apt-key list' returned a non-zero code: 2
My DockerFile:
# vim:set ft=dockerfile:
FROM ubuntu:focal
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mysql && useradd -r -g mysql mysql
# https://bugs.debian.org/830696 (apt uses gpgv by default in newer releases, rather than gpg)
RUN set -ex; \
apt-get update; \
if ! which gpg; then \
apt-get install -y --no-install-recommends gnupg; \
fi; \
if ! gpg --version | grep -q '^gpg (GnuPG) 1\.'; then \
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr
# so, if we're not running gnupg 1.x, explicitly install dirmngr too
apt-get install -y --no-install-recommends dirmngr; \
fi; \
rm -rf /var/lib/apt/lists/*
# add gosu for easy step-down from root
# https://github.com/tianon/gosu/releases
ENV GOSU_VERSION 1.12
RUN set -eux; \
savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
apt-get install -y --no-install-recommends ca-certificates wget; \
rm -rf /var/lib/apt/lists/*; \
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
chmod +x /usr/local/bin/gosu; \
gosu --version; \
gosu nobody true
RUN mkdir /docker-entrypoint-initdb.d
# install "pwgen" for randomizing passwords
# install "tzdata" for /usr/share/zoneinfo/
# install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
pwgen \
tzdata \
xz-utils \
; \
rm -rf /var/lib/apt/lists/*
ENV GPG_KEYS \
# pub rsa4096 2016-03-30 [SC]
# 177F 4010 FE56 CA33 3630 0305 F165 6F24 C74C D1D8
# uid [ unknown] MariaDB Signing Key <signing-key#mariadb.org>
# sub rsa4096 2016-03-30 [E]
177F4010FE56CA3336300305F1656F24C74CD1D8
RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
for key in $GPG_KEYS; do \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
done; \
gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \
command -v gpgconf > /dev/null && gpgconf --kill all || :; \
rm -r "$GNUPGHOME"; \
apt-key list
# bashbrew-architectures: amd64 arm64v8 ppc64le
ENV MARIADB_MAJOR 10.5
ENV MARIADB_VERSION 1:10.5.8+maria~focal
# release-status:Stable
# (https://downloads.mariadb.org/mariadb/+releases/)
RUN set -e;\
echo "deb http://ftp.osuosl.org/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu focal main" > /etc/apt/sources.list.d/mariadb.list; \
{ \
echo 'Package: *'; \
echo 'Pin: release o=MariaDB'; \
echo 'Pin-Priority: 999'; \
} > /etc/apt/preferences.d/mariadb
# add repository pinning to make sure dependencies from this MariaDB repo are preferred over Debian dependencies
# libmariadbclient18 : Depends: libmysqlclient18 (= 5.5.42+maria-1~wheezy) but 5.5.43-0+deb7u1 is to be installed
# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql)
# also, we set debconf keys to make APT a little quieter
RUN set -ex; \
{ \
echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \
echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password_again password 'unused'; \
} | debconf-set-selections; \
apt-get update; \
apt-get install -y \
"mariadb-server=$MARIADB_VERSION" \
# mariadb-backup is installed at the same time so that `mysql-common` is only installed once from just mariadb repos
mariadb-backup \
socat \
; \
rm -rf /var/lib/apt/lists/*; \
# purge and re-create /var/lib/mysql with appropriate ownership
rm -rf /var/lib/mysql; \
mkdir -p /var/lib/mysql /var/run/mysqld; \
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
chmod 777 /var/run/mysqld; \
# comment out a few problematic configuration values
find /etc/mysql/ -name '*.cnf' -print0 \
| xargs -0 grep -lZE '^(bind-address|log|user\s)' \
| xargs -rt -0 sed -Ei 's/^(bind-address|log|user\s)/#&/'; \
# don't reverse lookup hostnames, they are usually another container
echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf
VOLUME /var/lib/mysql
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 3306
RUN apt-get update
#RUN apt-get install -y software-properties-common
#RUN apt-get update
RUN apt-get install -y apache2 curl nano php libapache2-mod-php php7.4-mysql
EXPOSE 80
COPY calculadora.html /var/www/html/
COPY calculadora.php /var/www/html/
COPY success.html /var/www/html/
COPY start.sh /
COPY 50-server.cnf /etc/mysql/mariadb.conf.d/
RUN chmod 777 /start.sh
CMD ["/start.sh"]
'''
The error is because some servers that used the Mariadb image in the Dockerfile are down. Just need to update them.

EBS FFMPEG Not Installing from ebexentsions

I am trying to install FFMPEG on EBS. I have the following in the directory:
rootfolder/.ebextensions/packages.config
With the following info inside the file:
packages:
yum:
ImageMagick: []
ImageMagick-devel: []
commands:
01-wget:
command: "wget -O /tmp/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-i686-static.tar.xz"
02-mkdir:
command: "if [ ! -d /opt/ffmpeg ] ; then mkdir -p /opt/ffmpeg; fi"
03-tar:
command: "tar xvf /tmp/ffmpeg.tar.xz -C /opt/ffmpeg"
04-ln:
command: "if [[ ! -f /usr/bin/ffmpeg ]] ; then ln -sf /opt/ffmpeg/ffmpeg-3.4-64bit-static/ffmpeg /usr/bin/ffmpeg; fi"
05-ln:
command: "if [[ ! -f /usr/bin/ffprobe ]] ; then ln -sf /opt/ffmpeg/ffmpeg-3.4-64bit-static/ffprobe /usr/bin/ffprobe; fi"
06-pecl:
command: "if [ `pecl list | grep imagick` ] ; then pecl install -f imagick; fi"
ut when I sSH into my instang, the ffmpeg command is not installed. Any ideas as to why?
It does not work because you are linking wrong version.
You are trying to link:
/opt/ffmpeg/ffmpeg-3.4-64bit-static/ffmpeg
However, it should be:
/opt/ffmpeg/ffmpeg-4.3.1-i686-static/ffmpeg
Same for ffprobe. It should be:
/opt/ffmpeg/ffmpeg-4.3.1-i686-static/ffprobe

Django application in Docker gives FileNotFoundError: [Errno 2] No such file or directory: '/tmp/

I'm using Docker with python:3.7.6-slim image to dockerize the Django application.
I'm using django-import-export plugin to import data in the admin panel which stores the uploaded file in the temporary directory to read while importing.
But on import, it gives an error
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmppk01nf3d'
The same is working when not using docker.
Dockerfile
FROM python:3.7.6-slim
ARG APP_USER=appuser
RUN groupadd -r ${APP_USER} && useradd --no-log-init -r -g ${APP_USER} ${APP_USER}
RUN set -ex \
&& RUN_DEPS=" \
libpcre3 \
mime-support \
default-libmysqlclient-dev \
inkscape \
libcurl4-nss-dev libssl-dev \
" \
&& seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} \
&& apt-get update && apt-get install -y --no-install-recommends $RUN_DEPS \
&& pip install pipenv \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /home/${APP_USER}/.config/inkscape \
&& chown -R ${APP_USER} /home/${APP_USER}/.config/inkscape \
# Create directories
&& mkdir /app/ \
&& mkdir /app/config/ \
&& mkdir /app/scripts/ \
&& mkdir -p /static_cdn/static_root/ \
&& chown -R ${APP_USER} /static_cdn/
WORKDIR /app/
COPY Pipfile Pipfile.lock /app/
RUN set -ex \
&& BUILD_DEPS=" \
build-essential \
libpcre3-dev \
libpq-dev \
" \
&& apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
&& pipenv install --deploy --system \
\
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
&& rm -rf /var/lib/apt/lists/*
COPY ./src /app/
COPY scripts/ /app/scripts/
COPY configs/ /app/configs/
EXPOSE 8000
ENV UWSGI_WSGI_FILE=qcg/wsgi.py
ENV UWSGI_HTTP=:8000 UWSGI_MASTER=1 UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy
ENV UWSGI_WORKERS=2 UWSGI_THREADS=4
ENV UWSGI_STATIC_MAP="/static/=/static_cdn/static_root/" UWSGI_STATIC_EXPIRES_URI="/static/.*\.[a-f0-9]{12,}\.(css|js|png|jpg|jpeg|gif|ico|woff|ttf|otf|svg|scss|map|txt) 315360000"
USER ${APP_USER}:${APP_USER}
ENTRYPOINT ["/app/scripts/docker/entrypoint.sh"]
and running command
docker run my-image uwsgi --show-config