Commit b86368a2 authored by Álax Alves's avatar Álax Alves

Dockerizes slave

parent d3187609
Pipeline #33006527 passed with stage
in 2 minutes and 28 seconds
File mode changed from 100644 to 100755
version: '2'
services:
web:
build:
context: .
dockerfile: ./docker/Dockerfile.slave.dev
ports:
- 8000:8000
depends_on:
- postgres
env_file: ./docker/dev-env
volumes:
- .:/SMI-UnB
postgres:
image: postgres:9.6
volumes:
- ./docker/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- data
env_file:
- ./docker/dev-env
redis:
image: redis:4.0.11
depends_on:
- postgres
volumes:
data: {}
FROM python:3.5
RUN apt-get update &&\
apt-get install --no-install-recommends --no-install-suggests -y \
\
# Extra deps
cron \
libpq-dev \
python3-pip \
postgresql \
postgresql-client
# Base deps
RUN pip3 install \
requests[security]==2.19.1 \
django==2.0.2 \
psycopg2==2.6.2 \
gunicorn==19.9.0 \
redis==2.10.3 \
django-redis==4.3.0 \
invoke==1.2.0 \
numpy==1.15.2 \
pandas==0.23.4 \
Sphinx==1.8.1 \
django-polymorphic==2.0.2 \
manuel==1.9.0 \
mpld3==0.3 \
six==1.11.0 \
unipath==1.1 \
django_cron==0.5.1 \
matplotlib==3.0.0 \
djangorestframework==3.8.2
RUN mkdir -p /app
WORKDIR /app
COPY [ \
"setup.py", \
"requirements.txt", \
"boilerplate.ini", \
"manage.py", \
"tasks.py", \
"/app/" \
]
COPY src/ /app/src/
ENV PYTHONPATH=src \
SMI_UNB_PRODUCTION=true
# Setting cron
ADD crons/master_cron /etc/cron.d/smi-cron
RUN chmod 0644 /etc/cron.d/smi-cron
RUN touch /var/log/cron.log
RUN /usr/bin/crontab /etc/cron.d/smi-cron
# Initializing container with script
ADD scripts/start.sh /bin/start.sh
CMD /bin/bash /bin/start.sh
FROM python:3.5
RUN apt-get update &&\
apt-get install --no-install-recommends --no-install-suggests -y \
\
# Extra deps
cron \
libpq-dev \
python3-pip \
postgresql \
postgresql-client
# Base deps
RUN pip3 install \
requests[security]==2.19.1 \
django==2.0.2 \
psycopg2==2.6.2 \
gunicorn==19.9.0 \
redis==2.10.3 \
django-redis==4.3.0 \
invoke==1.2.0 \
numpy==1.15.2 \
pandas==0.23.4 \
Sphinx==1.8.1 \
django-polymorphic==2.0.2 \
manuel==1.9.0 \
mpld3==0.3 \
six==1.11.0 \
unipath==1.1 \
django_cron==0.5.1 \
matplotlib==3.0.0 \
djangorestframework==3.8.2
WORKDIR /SMI-UnB
COPY . /SMI-UnB
ENV PYTHONPATH=src \
SMI_UNB_PRODUCTION=False \
PYTHONUNBUFFERED=1
# Setting cron
COPY crons/slave_cron /etc/cron.hourly/smi-cron
RUN /usr/bin/crontab /etc/cron.hourly/smi-cron
# Initializing container with script
CMD ["sh", "scripts/start.sh"]
DB_NAME=postgres
DB_USER=postgres
DB_PASS=password
DB_SERVICE=postgres
DB_PORT=5432
#!/bin/env bash
#!/bin/dev-env bash
psql -U postgres -c "CREATE USER $DB_USER PASSWORD '$DB_PASS'"
psql -U postgres -c "CREATE DATABASE $DB_NAME OWNER $DB_USER"
\ No newline at end of file
......@@ -78,6 +78,9 @@ class TestDataReaderModels(TestCase):
int_message = messages[0]
float_message = messages[1]
print('aaaaaaaaaaaaaa')
print(b'\x01\x03\x00\x04\x00\x01\xc5\xcb')
print('aaaaaaaaaaaaaa')
self.assertEqual(b'\x01\x03\x00\x04\x00\x01\xc5\xcb', int_message)
self.assertEqual(b'\x01\x03\x00D\x00\x02\x84\x1e', float_message)
......
......@@ -204,7 +204,7 @@ STATICFILES_DIRS = [
PROJECT_DIR = Path(__file__).parent
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment