Skip to content

Commit a53590f

Browse files
authored
commit to fix prod environment (#67)
1 parent b0f0367 commit a53590f

File tree

5 files changed

+46
-236
lines changed

5 files changed

+46
-236
lines changed

Dockerfile.prod

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ nodejs \
1010
&& apt-get -q clean \
1111
&& rm -rf /var/lib/apt/lists
1212

13-
#Preinstall gems with native extensions
14-
RUN gem install nokogiri -v "1.10.3"
15-
1613
WORKDIR /usr/src/app
1714
COPY Gemfile* ./
1815
RUN bundle install

Gemfile.lock

-225
This file was deleted.

app/controllers/logs_controller.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def index
77
@patient = current_patient.nil? ? Patient.find(params[:patient]) : current_patient
88
@logs = Log.all.map{|log| log if log.patient_medical.patient == @patient }.compact
99
@tracked_variables = @patient.registered_variables
10+
@log = Log.new
1011
end
1112

1213
def new
@@ -62,4 +63,4 @@ def calculate_status
6263
return "delayed"
6364
end
6465
end
65-
end
66+
end

app/views/logs/index.html.erb

+29-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="d-flex w-75 justify-content-start">
33
<h2>Registro de Variables</h2>
44
</div>
5-
</div>
5+
</div>
66
<div class="d-flex w-75 justify-content-center">
77
<div class="d-flex w-75 justify-content-start">
88
<h4 class="badge badge-info"><%="#{ @patient.first_name.titleize } #{ @patient.last_name.titleize }"%></h4>
@@ -13,6 +13,33 @@
1313
<h4 class="badge badge-dark"><%="#{@patient.doctor.sex == 'male' ? 'Dr.' : 'Dra.'} #{ @patient.doctor.first_name.titleize } #{ @patient.doctor.last_name.titleize }"%></h4>
1414
</div>
1515
</div>
16+
<div class=" w-75 justify-content-center">
17+
18+
<% if @patient.variables_with_patient_medical.empty? %>
19+
<h3 class="d-flex w-100 justify-content-center text-muted">No tienes registros de variables pendientes.</h3>
20+
<% else %>
21+
<% @patient.variables_with_patient_medical.each do |variable| %>
22+
<%= form_for(@log) do |f| %>
23+
<div class="form-row">
24+
<div class="form-group col-6">
25+
<h4>Variable a Registrar</h4>
26+
<%= f.select :patient_medical_id, variable, {}, {class: "form-control"} %>
27+
</div>
28+
<div class="form-group col-6">
29+
<h4>Valor a Registrar</h4>
30+
<%= f.text_field :value, class: "registration_input pl-2 h-5" %>
31+
</div>
32+
</div>
33+
34+
<div class="form-row">
35+
<div class="form-group col-md-6">
36+
<%= f.submit "Registrar", class: 'btn btn-primary' %>
37+
</div>
38+
</div>
39+
<% end %>
40+
<% end %>
41+
<% end %>
42+
</div>
1643
<div class="d-flex w-100 justify-content-center">
1744
<div class="d-inline-block col-md-8">
1845
<% if current_doctor.nil? %>
@@ -77,4 +104,4 @@
77104
function print_page() {
78105
window.print()
79106
}
80-
</script>
107+
</script>

docker-compose.prod.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ volumes:
77
external: false
88
db-data:
99
external: false
10+
postgres-data:
11+
driver: local
12+
gems:
13+
driver: local
1014

1115
services:
1216
webserver:
@@ -18,11 +22,17 @@ services:
1822
volumes:
1923
- assets:/usr/share/nginx/html
2024
- configs:/etc/nginx/conf.d
21-
prod_db:
22-
image: "postgres:11.4"
23-
env_file: .env.prod
25+
26+
db:
27+
image: postgres:11.4
28+
ports:
29+
- 5433:5432
2430
volumes:
25-
- db-data:/var/lib/postgresql/data
31+
- .:/code
32+
- postgres-data:/var/lib/postgresql/data
33+
environment:
34+
LC_ALL: C.UTF-8
35+
POSTGRES_PASSWORD: P4Ssw0rD!
2636

2737
prod_app:
2838
build:
@@ -39,5 +49,5 @@ services:
3949
- assets:/usr/share/nginx/html
4050
- configs:/etc/nginx/conf.d
4151
depends_on:
42-
- prod_db
52+
- db
4353
- webserver

0 commit comments

Comments
 (0)