Skip to content
Snippets Groups Projects
Commit 6a171c34 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

reconfiguring atdb for ldv

parent dc6b40c4
Branches
No related tags found
No related merge requests found
FROM python:3.6.7-alpine
ENV PYTHONUNBUFFERED 1
RUN apk update && apk add bash && apk add nano mc
RUN mkdir /code
WORKDIR /code
COPY . /code/
RUN \
apk add --no-cache python3 postgresql-libs && \
apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev postgresql-dev && \
pip install -r requirements/prod.txt && \
pip install https://support.astron.nl/nexus/content/repositories/snapshots/nl/astron/alta/ALTA_interface_lib/ALTA_interface_lib-1.0.0-dev-20180925_011101.tar.gz --upgrade && \
apk --purge del .build-deps
CMD exec gunicorn atdb.wsgi_docker_vm:application --bind 0.0.0.0:8010 --workers 3
# RUN exec python manage.py collectstatic --settings=atdb.settings.prod
# EXPOSE 8010
# build the image like this:
# docker build -t atdb_web:latest .
# run the container from here, like this:
# sudo docker run -d --name atdb_web -p 8010:8010 --restart always atdb_web:latest
\ No newline at end of file
[2018-11-05 13:31:17,917] SIGNAL : pre_save DataProduct(WSRTA181027003_B000.MS)
[2018-11-05 13:31:17,917] handle_pre_save(WSRTA181027003_B000.MS)
[2018-11-05 13:31:17,918] disconnect_signals
[2018-11-05 13:31:17,930] connect_signals
[2018-11-05 13:31:17,931] SIGNAL : post_save DataProduct(WSRTA181027003_B000.MS)
[2018-11-05 13:31:17,931] handle_post_save(WSRTA181027003_B000.MS)
......@@ -52,8 +52,8 @@ DATABASES = {
# database runs locally in postgres
'NAME': 'atdb',
'HOST': '192.168.22.30',
'PORT': '5433',
'HOST': 'sdc.astron.nl',
'PORT': '5432',
# database runs on a virtual machine
# 'HOST': 'alta-sys-db.astron.nl',
......@@ -67,6 +67,3 @@ DATABASES = {
AUTH_PASSWORD_VALIDATORS = []
ALTA_HOST = "http://192.168.22.30/altapi"
ALTA_USER = "atdb_write"
ALTA_PASS = "7VVJruVn8W1n"
\ No newline at end of file
......@@ -11,6 +11,6 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "atdb.settings.docker_vm")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "atdb.settings.docker_dop457")
application = get_wsgi_application()
version: "3.7"
services:
db:
# image: atdb_postgres_dev:latest
build:
context: ./docker/postgres
dockerfile: Dockerfile
container_name: atdb_postgres_dev
ports:
- "5433:5432"
volumes:
- /home/vagrant/shared:/shared
restart: always
web:
build: .
container_name: atdb_web_dev
ports:
- "8010:8010"
expose:
- "8010"
depends_on:
- db
restart: always
nginx:
build:
context: ./docker/nginx
dockerfile: Dockerfile
container_name: atdb_nginx_dev
ports:
- "81:8011"
volumes:
- ./docker/nginx:/etc/nginx/conf.d
- /home/vagrant/shared/atdb/static:/static
depends_on:
- web
restart: always
#
# example Dockerfile for https://docs.docker.com/engine/examples/postgresql_service/
#
FROM ubuntu:16.04
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
# Add PostgreSQL's repository. It contains the most recent stable release
# of PostgreSQL, ``9.3``.
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
# There are some warnings (in red) that show up during the build. You can hide
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
# after each ``apt-get``
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
USER postgres
# Create a PostgreSQL role named ``dbadmin`` with ``dbadmin123`` as the password and
# then create a database `atdb` owned by the ``dbadmin`` role.
# Note: here we use ``&&\`` to run commands one after the other - the ``\``
# allows the RUN command to span multiple lines.
RUN /etc/init.d/postgresql start &&\
psql --command "CREATE USER dbadmin WITH SUPERUSER PASSWORD 'dbadmin123';" &&\
createdb -O dbadmin atdb
# Adjust PostgreSQL configuration so that remote connections to the
# database are possible.
RUN echo "local all dbadmin md5" >> /etc/postgresql/9.3/main/pg_hba.conf
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
# Add VOLUMEs to allow backup of config, logs and databases
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
# Set the default command to run when starting the container
CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]
# build the image like this:
# docker build -t atdb_postgres .
# run the container from here, like this:
# docker run -d --name atdb_postgres -p 5433:5432 --mount type=bind,source="/data/shared",target=/shared --restart always atdb_postgres
\ No newline at end of file
atdb/taskdatabase/static/taskdatabase/green_check.png

120 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment