Create container for proxy

This commit is contained in:
Mark Smith 2022-10-11 05:47:56 +00:00
parent 34f7410ff9
commit 3fe107dc71
6 changed files with 66 additions and 3 deletions

View File

@ -17,7 +17,7 @@ ENV DEBIAN_FRONTEND noninteractive
# Ubuntu level setup for the basics
RUN apt-get update && \
apt-get install -y apt-transport-https && \
apt-get install -y curl git cpanminus tzdata rsync && \
apt-get install -y curl git cpanminus tzdata rsync vim && \
bash -c 'echo "Etc/UTC" > /etc/timezone' && \
dpkg-reconfigure -f noninteractive tzdata && \
curl https://raw.githubusercontent.com/dreamwidth/dw-free/master/doc/dependencies-system | \

View File

@ -0,0 +1,41 @@
#
# This creates a Dreamwidth proxy container.
#
FROM ubuntu:18.04
MAINTAINER Mark Smith "mark@dreamwidth.org"
# Configuration can go here.
ARG COMMIT=master
# Things that commands need, but shouldn't change.
ENV LJHOME /dw
ENV DEBIAN_FRONTEND noninteractive
# Ubuntu level setup for the basics
RUN apt-get update && \
apt-get install -y apt-transport-https && \
apt-get install -y curl git cpanminus tzdata rsync vim golang-go && \
bash -c 'echo "Etc/UTC" > /etc/timezone' && \
dpkg-reconfigure -f noninteractive tzdata && \
rm -rf /var/lib/apt/lists/*
# Actually check out the source code now.
RUN git clone https://github.com/dreamwidth/dw-free.git $LJHOME && \
git -C $LJHOME checkout $COMMIT && \
git -C $LJHOME pull --ff-only origin $COMMIT && \
cd $LJHOME/src/proxy && \
go build
# Copy in support scripts/configurations that are useful.
ADD scripts/ /opt/
# Setup script that runs to make sure we get configs in the right place and do any
# last minute configuration.
RUN bash /opt/setup.sh
# We run our proxy on this port
EXPOSE 6250/tcp
# Kick off the startup script, which does things
CMD bash /opt/startup-prod.sh

View File

@ -0,0 +1,8 @@
#!/bin/bash
#
# Designed to be run as part of the Docker setup. Do not run this
# script manually.
#
# Prepare cache directory
mkdir /dw/var/proxy

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -xe
# Start proxy into background somewhere
/dw/src/proxy/proxy \
-port 6250 \
-salt_file=/dw/etc/proxy-salt \
-hotlink_domain=dreamwidth.org \
-cache_dir=/dw/var/proxy
# Now we "wait" by tailing the error log, so we can see it without having
# to attach to the container
tail -F /var/log/apache2/error.log

View File

@ -14,7 +14,7 @@ ENV LJHOME /dw
# Install some packages we need in web only.
RUN echo $COMMIT && \
apt-get update && \
apt-get install -y mysql-client vim-tiny varnish && \
apt-get install -y mysql-client varnish && \
curl https://raw.githubusercontent.com/dreamwidth/dw-free/master/doc/dependencies-system | \
xargs apt-get -y install && \
curl https://raw.githubusercontent.com/dreamwidth/dw-free/master/doc/dependencies-cpanm | \

View File

@ -14,7 +14,7 @@ ENV LJHOME /dw
# Install some packages we need in workers only.
RUN echo $COMMIT && \
apt-get update && \
apt-get install -y mysql-client vim-tiny && \
apt-get install -y mysql-client && \
curl https://raw.githubusercontent.com/dreamwidth/dw-free/master/doc/dependencies-system | \
xargs apt-get -y install && \
curl https://raw.githubusercontent.com/dreamwidth/dw-free/master/doc/dependencies-cpanm | \