Skip to content

Commit

Permalink
feat: Rename dockerfiles, use alpine-nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdor authored and AEtherC0r3 committed Sep 29, 2018
1 parent 0a26219 commit 4aebbf8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 42 deletions.
9 changes: 4 additions & 5 deletions grnet/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
version: '2'
version: "3.2"

services:

website:
build:
context: .
dockerfile: Website-Dockerfile
dockerfile: website.dockerfile
links:
- mqtt
expose:
Expand Down Expand Up @@ -44,7 +43,7 @@ services:
ministerin:
build:
context: .
dockerfile: MinisterIN-Dockerfile
dockerfile: ministerIN.dockerfile
ports:
- "7777:7777"
depends_on:
Expand All @@ -54,7 +53,7 @@ services:
mqtt:
build:
context: .
dockerfile: MQTT-Dockerfile
dockerfile: mqtt.dockerfile
volumes:
- ./credentials/mqtt:/var/local/mosquitto:ro
ports:
Expand Down
7 changes: 2 additions & 5 deletions grnet/MinisterIN-Dockerfile → grnet/ministerIN.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
# Use the alpine Node.js base image
FROM node:8-alpine

# File Author / Maintainer
MAINTAINER AEtherC0r3

################## BEGIN INSTALLATION ######################

# Update repositories and install git
RUN apk update && apk add git
RUN apk add --update --no-cache git

# Clone repo
RUN git clone https://github.com/lambdaspace/MinisterIN.git
Expand All @@ -25,5 +22,5 @@ RUN yarn install
EXPOSE 7777

################## INSTALLATION END ######################

USER 1000
CMD node MinisterIN.js
14 changes: 3 additions & 11 deletions grnet/MQTT-Dockerfile → grnet/mqtt.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@
# Based on Debian
############################################################

# Set the base image to Debian
FROM debian:jessie

# File Author / Maintainer
MAINTAINER aldor
# Set the base image to Debia
FROM debian:stretch

################## BEGIN INSTALLATION ######################
RUN apt-get update && apt-get install -y wget
RUN wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
RUN apt-key add mosquitto-repo.gpg.key
RUN wget -O /etc/apt/sources.list.d/mosquitto-jessie.list http://repo.mosquitto.org/debian/mosquitto-jessie.list

RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y ca-certificates mosquitto
apt-get install -y apt-transport-https ca-certificates mosquitto

# Mosquito configuration
COPY credentials/mqtt /var/local/mosquitto
Expand Down
1 change: 0 additions & 1 deletion grnet/website-nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
Expand Down
25 changes: 6 additions & 19 deletions grnet/Website-Dockerfile → grnet/website.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
############################################################

# Use the Node image to build the website's assets
FROM node:8.11.3-stretch as asset_builder
FROM node:10-stretch as asset_builder

RUN git clone https://github.com/lambdaspace/new_website.git

Expand All @@ -15,25 +15,13 @@ RUN node_modules/.bin/gulp --production
RUN rm -r node_modules

# Set the base image to Debian
FROM debian:jessie

# File Author / Maintainer
MAINTAINER aldor
FROM nginx:alpine

################## BEGIN INSTALLATION ######################
# Update the repository sources list
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
RUN echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list

ENV NGINX_VERSION 1.9.7-1~jessie

RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y ca-certificates nginx=${NGINX_VERSION} cron ruby
RUN apk add --update --no-cache ruby ruby-bundler ca-certificates &&\
echo 'gem: --no-document' > /etc/gemrc

RUN echo "*/5 * * * * wget https://community.lambdaspace.gr/c/5/l/latest.json -O /usr/share/nginx/html/latest.json" >> mycron
RUN crontab mycron
RUN rm mycron
RUN echo "*/5 * * * * wget https://community.lambdaspace.gr/c/5/l/latest.json -O /usr/share/nginx/html/latest.json" >> mycron && crontab mycron && rm mycron

# Mqtt script
COPY mqtt.rb /var/local/
Expand All @@ -51,5 +39,4 @@ COPY --from=asset_builder /new_website/* ./
################## INSTALLATION END ######################

EXPOSE 80 443
CMD service cron start && service nginx stop && git pull origin master && \
service nginx start && gem install mqtt && ruby /var/local/mqtt.rb && /bin/bash
CMD nginx -g "daemon off;" && gem install mqtt && ruby /var/local/mqtt.rb && /bin/bash
2 changes: 1 addition & 1 deletion hostdog/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: "3.2"

services:
proxy:
Expand Down

0 comments on commit 4aebbf8

Please sign in to comment.