diff options
-rw-r--r-- | apps/mi-gateway/Dockerfile | 6 | ||||
-rw-r--r-- | apps/mi-gateway/server.js | 7 | ||||
-rw-r--r-- | apps/mi-processor/Dockerfile | 6 | ||||
-rw-r--r-- | terraform/ansible/all.yml | 3 | ||||
-rw-r--r-- | terraform/ansible/group_vars/all/timezone.yml | 1 | ||||
-rw-r--r-- | terraform/ansible/roles/timezone/handlers/main.yml | 2 | ||||
-rw-r--r-- | terraform/ansible/roles/timezone/tasks/main.yml | 8 |
7 files changed, 24 insertions, 9 deletions
diff --git a/apps/mi-gateway/Dockerfile b/apps/mi-gateway/Dockerfile index dbb042d..4d5609d 100644 --- a/apps/mi-gateway/Dockerfile +++ b/apps/mi-gateway/Dockerfile @@ -2,13 +2,11 @@ FROM node:8 WORKDIR /opt -COPY package*.json ./ - RUN apt update && apt -y full-upgrade RUN apt install -y postgresql-client + +COPY package*.json ./ RUN npm install -# If you are building your code for production -# RUN npm ci --only=production COPY . . diff --git a/apps/mi-gateway/server.js b/apps/mi-gateway/server.js index 4d2546f..a0f3a04 100644 --- a/apps/mi-gateway/server.js +++ b/apps/mi-gateway/server.js @@ -7,7 +7,12 @@ const HOST = '0.0.0.0'; const app = express(); app.get('/', (req, res) => { - res.send('mi-gateway 2\n'); + res.set('Content-Type', 'text/plain'); + res.send('mi-gateway\n' + + '$HOSTNAME = ' + process.env["HOSTNAME"] + '\n' + + '$PGDATABASE = ' + process.env["PGDATABASE"] + '\n' + + '$PGHOST = ' + process.env["PGHOST"] + '\n' + + '$PGUSER = ' + process.env["PGUSER"] + '\n'); }); app.listen(PORT, HOST); diff --git a/apps/mi-processor/Dockerfile b/apps/mi-processor/Dockerfile index dbb042d..4d5609d 100644 --- a/apps/mi-processor/Dockerfile +++ b/apps/mi-processor/Dockerfile @@ -2,13 +2,11 @@ FROM node:8 WORKDIR /opt -COPY package*.json ./ - RUN apt update && apt -y full-upgrade RUN apt install -y postgresql-client + +COPY package*.json ./ RUN npm install -# If you are building your code for production -# RUN npm ci --only=production COPY . . diff --git a/terraform/ansible/all.yml b/terraform/ansible/all.yml index 636c0d1..e69d3f8 100644 --- a/terraform/ansible/all.yml +++ b/terraform/ansible/all.yml @@ -13,6 +13,9 @@ - role: apt-repos tags: apt-repos become: yes + - role: timezone + tags: timezone + become: yes - hosts: k8s-master tags: k3s, k8s diff --git a/terraform/ansible/group_vars/all/timezone.yml b/terraform/ansible/group_vars/all/timezone.yml new file mode 100644 index 0000000..6597991 --- /dev/null +++ b/terraform/ansible/group_vars/all/timezone.yml @@ -0,0 +1 @@ +timezone: Europe/Oslo diff --git a/terraform/ansible/roles/timezone/handlers/main.yml b/terraform/ansible/roles/timezone/handlers/main.yml new file mode 100644 index 0000000..8260d66 --- /dev/null +++ b/terraform/ansible/roles/timezone/handlers/main.yml @@ -0,0 +1,2 @@ +- name: reconfigure tzdata + shell: dpkg-reconfigure -f noninteractive tzdata diff --git a/terraform/ansible/roles/timezone/tasks/main.yml b/terraform/ansible/roles/timezone/tasks/main.yml new file mode 100644 index 0000000..2bb82c5 --- /dev/null +++ b/terraform/ansible/roles/timezone/tasks/main.yml @@ -0,0 +1,8 @@ +- tags: + - timezone + file: + src: "/usr/share/zoneinfo/{{ timezone }}" + dest: /etc/localtime + state: link + force: yes + notify: reconfigure tzdata |