Skip to content

Commit 26e5202

Browse files
author
Topi Paavilainen
committed
work in progress
1 parent 303dc76 commit 26e5202

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM ubuntu:latest
2+
3+
COPY . /
4+
5+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
6+
7+
8+
### APT-GET ###
9+
10+
RUN apt-get update
11+
RUN apt-get install -y \
12+
build-essential htop \
13+
python-dev python-pip python-virtualenv \
14+
libxml2-dev libxslt1-dev \
15+
libcurl4-openssl-dev libssl-dev zlib1g-dev libpcre3-dev \
16+
libldap2-dev libsasl2-dev \
17+
libjpeg-dev \
18+
libfreetype6-dev \
19+
postgresql libpq-dev \
20+
npm \
21+
memcached \
22+
supervisor
23+
24+
RUN ln -s /usr/bin/nodejs /usr/bin/node
25+
26+
27+
### DEPENDENCIES ###
28+
29+
RUN apt-get install -y libffi-dev && pip install -r requirements.txt
30+
RUN npm install
31+
32+
33+
### POSTGRES ####
34+
35+
RUN mkdir -p media/portraits/full media/portraits/thumb media/portraits/badge
36+
USER postgres
37+
RUN /etc/init.d/postgresql start &&\
38+
psql --command 'CREATE USER root;' &&\
39+
createdb -O root fum
40+
USER root
41+
RUN /etc/init.d/postgresql start &&\
42+
./manage.py migrate --noinput &&\
43+
./manage.py datamigrate &&\
44+
./manage.py collectstatic --noinput
45+
46+
47+
### SOLR ###
48+
49+
50+
51+
52+
###
53+
54+
55+
56+
EXPOSE 8000
57+
58+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

fum/management/commands/datamigrate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def val(v, member):
106106
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, 0)
107107

108108
con = ldap.initialize(ldap_server)
109-
con.start_tls_s()
109+
if settings.USE_TLS:
110+
con.start_tls_s()
110111
con.simple_bind_s(dn,pw)
111112

112113
# get users from ldap

supervisord.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
[program:fum]
5+
command: ./manage.py runserver --nostatic 0.0.0.0:8080
6+
7+
[program:postgres]
8+
command: service postgresql restart

0 commit comments

Comments
 (0)