Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Fix docker-compose setup #82

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jaswdr
Copy link

@jaswdr jaswdr commented Jun 24, 2021

Fix #7:

  1. Change root docker image from alpine to Debian, some packages like pandas are not correctly installed using default settings.
  2. Load SECRET_KEY from environment.
  3. Replace censo/manage.py with ./manage.py in command parameter.
  4. Replace volume /censo with correct /code used in Dockerfile

Testing:

Building docker-compose services:

$ docker-compose build
...
 ---> Running in 7b8769ecd814
Removing intermediate container 7b8769ecd814
 ---> ee0839e0cb12
Successfully built ee0839e0cb12
Successfully tagged censo-querido-diario_web:latest

Running locally:

$ docker-compose up -d
Creating network "censo-querido-diario_default" with the default driver
Creating censo ... done
$ docker-compose logs
Attaching to censo
censo  | No changes detected
censo  | Operations to perform:
censo  |   Apply all migrations: admin, auth, contenttypes, formulario, sessions
censo  | Running migrations:
censo  |   No migrations to apply.
censo  | Watching for file changes with StatReloader
censo  | Performing system checks...
censo  |
censo  | System check identified no issues (0 silenced).
censo  | June 24, 2021 - 20:47:02
censo  | Django version 3.1.1, using settings 'censo.settings'
censo  | Starting development server at http://0.0.0.0:8000/
censo  | Quit the server with CONTROL-C.

Checking HTTP server response:

$ curl http://localhost:8000
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/static/css/bootstrap.css">
    <link rel="stylesheet" href="/static/css/style.css">

    <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.12/css/select2.min.css" type="text/css" media="screen" rel="stylesheet">
    <style type="text/css">
      select {
        width: 200px;
      }
    </style>

    <title>Mapeamento dos Diários Oficiais municipais do Brasil</title>
  </head>
  <body>
    <div class="container general-container">
      <div class="row justify-content-center">
        <div class="conteudo-bloco col-8 shadow p-3 mb-5 rounded">
                  <div class="qd-logo mr-auto ml-auto">
                    <img src="../static/images/qd-logo.png" class="img-fluid">
...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problemas inicialização com docker compose.
1 participant