Dockerfile 3.68 KB
Newer Older
nabil el mahiri committed
1
# Stage 0, "build-stage", based on Node.js, to build and compile Angular
nabil el mahiri committed
2
FROM node:6.11.1 as build-stage
nabil el mahiri committed
3 4 5 6 7

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade

# Installing supervisord
nabil el mahiri committed
8 9
RUN apt-get install -y supervisor && \
apt-get install -y gnupg2 && apt-get install -y gnupg2 && \
nabil el mahiri committed
10
apt-get -yq install ssh && \
nabil el mahiri committed
11 12
apt-get -yq install curl  

nabil el mahiri committed
13

nabil el mahiri committed
14 15
ADD ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf 
 
nabil el mahiri committed
16 17 18 19 20 21 22 23 24 25 26 27
RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install net-tools nginx lsb-release

RUN rm -f /etc/nginx/fastcgi.conf /etc/nginx/fastcgi_params && \
    rm -f /etc/nginx/snippets/fastcgi-php.conf /etc/nginx/snippets/snakeoil.conf \
    rm -f /etc/nginx/sites-available/default \
    rm -f /etc/nginx/sites-enabled/default

COPY /nginx/default.conf /etc/nginx/sites-available
COPY /nginx/default.conf /etc/nginx/sites-enabled



nabil el mahiri committed
28
# RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
nabil el mahiri committed
29

nabil el mahiri committed
30
# RUN echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
nabil el mahiri committed
31

nabil el mahiri committed
32 33 34
# RUN apt-get update && apt-get -yq install mongodb-org && apt-get -yq install redis-server
# RUN mkdir -p /data/db
# RUN mongod --fork --syslog
nabil el mahiri committed
35

nabil el mahiri committed
36
# RUN apt-get -yq install expect-dev
nabil el mahiri committed
37 38 39 40
# sudo ./mongodb/bin/mongodump --host localhost --port 27017 --db atlasvoyages-dev --out ./

# sudo ./mongodb/bin/mongodump --host localhost --port 27017 --db atlasvoyages-dev --gzip --archive=atlasvoyages-dev.archive

41

nabil el mahiri committed
42

nabil el mahiri committed
43
WORKDIR /atlasvoyages
nabil el mahiri committed
44

nabil el mahiri committed
45

nabil el mahiri committed
46 47 48
COPY package*.json /atlasvoyages/


nabil el mahiri committed
49
RUN npm install --global grunt-cli 
50

51

nabil el mahiri committed
52
# RUN git config --global http.proxy http://<username>:<password>@<proxy-server-url>:<port>
nabil el mahiri committed
53

54
# RUN echo "//<npm-registry>:8080/:_authToken=KB9DEBiM5vNeGPwinPuj" > ~/.npmrc
nabil el mahiri committed
55

nabil el mahiri committed
56
# Take an SSH key as a build argument.
nabil el mahiri committed
57
ARG SSH_PRIVATE_KEY
nabil el mahiri committed
58
ARG BUILD_TOKEN
nabil el mahiri committed
59
# RUN echo exit 0 > /usr/sbin/policy-rc.d
nabil el mahiri committed
60

nabil el mahiri committed
61
RUN apt-get update && apt-get install -y openssh-server
nabil el mahiri committed
62 63 64 65
# 1. Create the SSH directory.
# 2. Populate the private key file.
# 3. Set the required permissions.
# 4. Add github to our list of known hosts for ssh.
nabil el mahiri committed
66 67 68 69 70
RUN mkdir ~/.ssh && \
    echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_rsa && \ 
    chmod 0600 ~/.ssh/id_rsa && \
    echo "Host labs.atlasvoyages.com"$'\n\t'"IdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
RUN touch ~/.ssh/known_hosts 
nabil el mahiri committed
71
RUN ssh-keyscan -t rsa labs.atlasvoyages.com >> ~/.ssh/known_hosts 
nabil el mahiri committed
72

nabil el mahiri committed
73
RUN cat ~/.ssh/known_hosts 
nabil el mahiri committed
74 75 76

# RUN ssh -T gitlab.com
# RUN ssh -T git@gitlab.com
nabil el mahiri committed
77
RUN ssh -T git@labs.atlasvoyages.com
nabil el mahiri committed
78
 
nabil el mahiri committed
79
# RUN sed -i 's/git+ssh:\/\/git@labs.atlasvoyages.com:/git+https:\/\/oauth2:'$BUILD_TOKEN'@glabs.atlasvoyages.com\//' ./package.json
nabil el mahiri committed
80 81
# RUN git clone https://nabilelmahiri:arigatou%4065@labs.atlasvoyages.com/pine/theme-atlasvoyages.git -b 0.3-beta-v1
RUN npm install --unsafe-perm=true 
nabil el mahiri committed
82
COPY ./ /atlasvoyages/
nabil el mahiri committed
83

nabil el mahiri committed
84
# RUN expect -f ./sh/npm_login_expect nabilelmahiri arigatou@65 "nabil.elmahiri@fractalite.com" && npm i -S git+http://nabilelmahiri@labs.atlasvoyages.com/pine/pine-express.git#0.3-dev
nabil el mahiri committed
85

nabil el mahiri committed
86
# RUN mongorestore --host localhost --port 27017 --gzip --archive=atlasvoyages-dev.archive
nabil el mahiri committed
87 88

RUN find ./node_modules -maxdepth 1 -name 'pine*' -type d \( ! -name . \) -exec bash -c "cd '{}' && npm i --unsafe-perm=true && grunt build:dist" \; \
89
    find ./node_modules -maxdepth 1 -name 'hermes*' -type d \( ! -name . \) -exec bash -c "cd '{}' && npm i --unsafe-perm=true && grunt build:dist" \; \
nabil el mahiri committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103
    find ./node_modules -maxdepth 1 -name 'theme-atlasvoyages*' -type d \( ! -name . \) -exec bash -c "cd '{}' && npm i --unsafe-perm=true && grunt build:dist" \;

RUN echo '\n' | grunt pine:setup

RUN grunt pine:copy


# expose port 80 443
EXPOSE 80
EXPOSE 443

# USER postgres
ENTRYPOINT ["/usr/bin/supervisord"]