This commit is contained in:
Jeffrey Paul 2020-03-04 21:19:37 -08:00
parent bdfb1f706a
commit ff137674fe
5 changed files with 139 additions and 1 deletions

74
Dockerfile Normal file
View File

@ -0,0 +1,74 @@
# focal 2020.01 dev
FROM ubuntu@sha256:d050ed7278c16ff627e4a70d7d353f1a2ec74d8a0b66e5a865356d92f5f6d87b
ENV DEBIAN_FRONTEND noninteractive
ARG UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu
RUN echo "deb $UBUNTU_MIRROR focal main universe restricted multiverse" > /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-updates main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-security main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-backports main universe restricted multiverse" >> /etc/apt/sources.list.new && \
mv /etc/apt/sources.list.new /etc/apt/sources.list
# we only install essential system packages here
ARG SYSTEM_PACKAGES="build-essential ca-certificates git golang rsync runit software-properties-common"
RUN \
apt update && \
apt -y upgrade && \
apt -y install $SYSTEM_PACKAGES && \
go get -v -u github.com/peterbourgon/runsvinit && \
cp /root/go/bin/runsvinit /usr/local/sbin/runsvinit && \
rm -r /root/go
COPY ./root /tmp/rootoverlay
RUN rsync -avP /tmp/rootoverlay/ / && \
rm -rf /tmp/rootoverlay
# prereqs for discourse
RUN apt update && \
apt -y install \
advancecomp \
autoconf \
automake \
bison \
curl \
debconf-utils \
expect \
gawk \
gifsicle \
git-core \
gnupg2 \
imagemagick \
jhead \
jpegoptim \
libcurl4-openssl-dev \
libffi-dev \
libgdbm-dev \
libjpeg-turbo-progs \
libncurses5-dev \
libpcre3 \
libpcre3-dev \
libreadline6-dev \
libsqlite3-dev \
libssl-dev \
libtool \
libyaml-dev \
openssl \
optipng \
pngcrush \
pngquant \
python3-software-properties \
redis-server \
ruby-full \
sqlite3 \
sudo \
vim \
zlib1g-dev
COPY ./run.sh /tmp/run.sh
RUN /bin/bash /tmp/run.sh && rm /tmp/run.sh
CMD ["/usr/local/sbin/runsvinit"]

8
Makefile Normal file
View File

@ -0,0 +1,8 @@
default: build
build:
docker build \
-t sneak/discourse \
--build-arg UBUNTU_MIRROR="http://ubuntu.datavi.be/ubuntu" \
.

View File

@ -1,2 +1,12 @@
# discourse-docker # datavibe-shell
This is the repository that builds the container for datavibe.net's user
shell service.
# Contributing
Pull requests are welcome.
# Author
sneak <[sneak@sneak.berlin](mailto:sneak@sneak.berlin)>

0
root/.keep Normal file
View File

46
run.sh Normal file
View File

@ -0,0 +1,46 @@
#!/bin/bash
export HOME=/root
set -e
set -x
apt-get -yqq update
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
curl -sSL https://get.rvm.io | bash -s stable
echo 'gem: --no-document' >> ~/.gemrc
set +e
set +x
source /etc/profile.d/rvm.sh
rvm install 2.6.2
rvm --default use 2.6.2
set -e
set -x
gem install bundler mailcatcher rake
# install pg10
# ubuntu has a bootstrap script for pg repo install:
apt install -y postgresql-common
sh /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
apt-get update
apt-get install postgresql-10 pgadmin4
# start postgres somehow
sudo -u postgres -i
createuser --superuser -Upostgres discourse
psql -c "ALTER USER discourse WITH PASSWORD 'password';"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
# FIXME activate nvm
find $HOME
exit 1
chmod +x /etc/service/*/run