AS
Size: a a a
AS
R
AS
AS
ЕJ
# ============================================================================ #
# set postgres password
RUN echo '\
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf & \n\
sleep 20 \n\
supervisorctl status \n\
cd ~postgres/ \n\
\n\
su postgres -c "psql -c \"ALTER USER postgres WITH PASSWORD postgres;\" " \n\
\n\
su postgres -c "psql -c \"CREATE DATABASE website;\" " \n\
su postgres -c "psql -c \"CREATE USER website WITH PASSWORD 'website';\" " \n\
su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE website TO website;\" " \n\
su postgres -c "psql -c \"ALTER DATABASE website OWNER TO website;\" " \n\
\n\
kill -s SIGTERM $(supervisorctl pid) \n\
unlink /run/supervisor.sock \n\
\n\
' > /init_pg_run.sh
RUN sed -ri "s/PASSWORD postgres/PASSWORD 'postgres'/" /init_pg_run.sh # fix
RUN sed -ri "s/PASSWORD website/PASSWORD 'website'/" /init_pg_run.sh # fix
#
RUN cat -n /init_pg_run.sh
RUN chmod +x /init_pg_run.sh
RUN /init_pg_run.sh
RUN rm /init_pg_run.sh
R
AS
# ============================================================================ #
# set postgres password
RUN echo '\
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf & \n\
sleep 20 \n\
supervisorctl status \n\
cd ~postgres/ \n\
\n\
su postgres -c "psql -c \"ALTER USER postgres WITH PASSWORD postgres;\" " \n\
\n\
su postgres -c "psql -c \"CREATE DATABASE website;\" " \n\
su postgres -c "psql -c \"CREATE USER website WITH PASSWORD 'website';\" " \n\
su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE website TO website;\" " \n\
su postgres -c "psql -c \"ALTER DATABASE website OWNER TO website;\" " \n\
\n\
kill -s SIGTERM $(supervisorctl pid) \n\
unlink /run/supervisor.sock \n\
\n\
' > /init_pg_run.sh
RUN sed -ri "s/PASSWORD postgres/PASSWORD 'postgres'/" /init_pg_run.sh # fix
RUN sed -ri "s/PASSWORD website/PASSWORD 'website'/" /init_pg_run.sh # fix
#
RUN cat -n /init_pg_run.sh
RUN chmod +x /init_pg_run.sh
RUN /init_pg_run.sh
RUN rm /init_pg_run.sh
EK
AS
# ============================================================================ #
# set postgres password
RUN echo '\
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf & \n\
sleep 20 \n\
supervisorctl status \n\
cd ~postgres/ \n\
\n\
su postgres -c "psql -c \"ALTER USER postgres WITH PASSWORD postgres;\" " \n\
\n\
su postgres -c "psql -c \"CREATE DATABASE website;\" " \n\
su postgres -c "psql -c \"CREATE USER website WITH PASSWORD 'website';\" " \n\
su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE website TO website;\" " \n\
su postgres -c "psql -c \"ALTER DATABASE website OWNER TO website;\" " \n\
\n\
kill -s SIGTERM $(supervisorctl pid) \n\
unlink /run/supervisor.sock \n\
\n\
' > /init_pg_run.sh
RUN sed -ri "s/PASSWORD postgres/PASSWORD 'postgres'/" /init_pg_run.sh # fix
RUN sed -ri "s/PASSWORD website/PASSWORD 'website'/" /init_pg_run.sh # fix
#
RUN cat -n /init_pg_run.sh
RUN chmod +x /init_pg_run.sh
RUN /init_pg_run.sh
RUN rm /init_pg_run.sh
ЕJ
cat >/etc/apt/sources.list <<EOL
deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main
deb http://ftp.nl.debian.org/debian/ jessie main
deb-src http://ftp.nl.debian.org/debian/ jessie main
deb http://ftp.nl.debian.org/debian/ testing main
EOL
AS
EK
cat >/etc/apt/sources.list <<EOL
deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main
deb http://ftp.nl.debian.org/debian/ jessie main
deb-src http://ftp.nl.debian.org/debian/ jessie main
deb http://ftp.nl.debian.org/debian/ testing main
EOL
EK
AS
EK
ЕJ
AS
AS
EK
EK