Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working ubuntu boot #5558

Merged
merged 3 commits into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
FROM python:3.7-alpine3.8
FROM ubuntu:18.04

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ARG PACKAGES="postgresql-libs libxml2 libxslt freetype libffi jpeg libmaxminddb bash git tar gzip inkscape libmagic"
ARG BUILD_DEPS="gcc g++ postgresql-dev libxml2-dev libxslt-dev freetype-dev libffi-dev jpeg-dev linux-headers autoconf automake libtool make dos2unix"
ENV DEBIAN_FRONTEND=noninteractive

ARG PACKAGES="libpq-dev libxml2 libxslt1-dev libfreetype6 libjpeg-dev libmaxminddb-dev bash git tar gzip inkscape libmagic-dev"
ARG BUILD_DEPS="gcc g++ postgresql libxml2-dev libxslt-dev libfreetype6 libffi-dev libjpeg-dev autoconf automake libtool make dos2unix libvips libvips-dev"
WORKDIR /code

# Inkscape
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:inkscape.dev/stable
RUN apt-get update

# Install general dependencies.
RUN apk add --no-cache --update $PACKAGES && \
apk add --no-cache --update --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ vips && \
apk add --no-cache --update --virtual .builder $BUILD_DEPS
RUN apt-get install -y $PACKAGES
RUN apt-get update
RUN apt-get install -y $BUILD_DEPS

RUN apt-get install -y wget

RUN apt-get install -y python3-pip

# GeoIP2 Data Files
RUN mkdir -p /usr/share/GeoIP/ && \
Expand All @@ -23,11 +35,12 @@ RUN mkdir -p /usr/share/GeoIP/ && \
RUN pip3 install --upgrade pip setuptools wheel dumb-init pipenv

COPY requirements/ /code/
RUN apt-get install -y build-essential libssl-dev python3-dev
RUN apt-get install -y libsecp256k1-dev
RUN pip3 install --upgrade -r test.txt

COPY bin/docker-command.bash /bin/docker-command.bash
RUN dos2unix /bin/docker-command.bash && \
apk del .builder
RUN dos2unix /bin/docker-command.bash

COPY app/ /code/app/

Expand Down
14 changes: 7 additions & 7 deletions bin/docker-command.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fi
GC_WEB_OPTS="${GC_WEB_WORKER} ${GC_WEB_INTERFACE:-0.0.0.0}:${GC_WEB_PORT:-8000}"

if [ "$VSCODE_DEBUGGER_ENABLED" = "on" ]; then
pip install ptvsd
pip3 install ptvsd
GC_WEB_OPTS="${GC_WEB_OPTS} --nothreading"
echo "VSCode remote debugger enabled! This has disabled threading!"
fi
Expand All @@ -43,31 +43,31 @@ fi
if [ ! -f /provisioned ] || [ "$FORCE_PROVISION" = "on" ]; then
echo "First run - Provisioning the local development environment..."
if [ "$DISABLE_INITIAL_CACHETABLE" != "on" ]; then
python manage.py createcachetable
python3 manage.py createcachetable
fi

if [ "$DISABLE_INITIAL_COLLECTSTATIC" != "on" ]; then
python manage.py collectstatic --noinput -i other &
python3 manage.py collectstatic --noinput -i other &
fi

if [ "$DISABLE_INITIAL_MIGRATE" != "on" ]; then
python manage.py migrate
python3 manage.py migrate
fi

if [ "$DISABLE_INITIAL_LOADDATA" != "on" ]; then
python manage.py loaddata initial
python3 manage.py loaddata initial
fi
date >> /provisioned
echo "Provisioning completed!"
fi

if [ "$FORCE_GET_PRICES" = "on" ]; then
python manage.py get_prices
python3 manage.py get_prices
fi

if [ "$KUDOS_LOCAL_SYNC" = "on" ]; then
bash /code/scripts/sync_kudos_listener_local.bash &
bash /code/scripts/sync_kudos_local.bash &
fi

exec python manage.py $GC_WEB_OPTS
exec python3 manage.py $GC_WEB_OPTS
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ services:
environment:
- PYTHONUNBUFFERED=1
- PYTHONPATH=/code/app
- PYTHONPATH=/usr/bin/python3
env_file:
- app/app/.env
build:
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync_kudos_listener_local.bash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python manage.py sync_kudos_listener localhost filter >> /var/log/sync_kudos_listener.log 2>&1
python3 manage.py sync_kudos_listener localhost filter >> /var/log/sync_kudos_listener.log 2>&1
2 changes: 1 addition & 1 deletion scripts/sync_kudos_local.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
while true; do
python manage.py sync_kudos localhost filter -s earliest >> /var/log/sync_kudos.log 2>&1
python3 manage.py sync_kudos localhost filter -s earliest >> /var/log/sync_kudos.log 2>&1
sleep 60
done