Dockerfile 2.41 KB
Newer Older
nabil el mahiri committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# Stage 0, "build-stage", based on Node.js, to build and compile Angular
FROM node:6.11.1 as build-stage

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

# Installing supervisord
RUN apt-get install -y supervisor  
ADD ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf 


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



RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

nabil el mahiri committed
26
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
27 28

RUN apt-get update && apt-get -yq install mongodb-org && apt-get -yq install redis-server
nabil el mahiri committed
29
RUN mkdir -p /data/db
30
RUN mongod --fork --syslog
nabil el mahiri committed
31

32
RUN apt-get -yq install expect-dev
nabil el mahiri committed
33 34 35 36
# 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

37 38
COPY ./ /atlasvoyages/

nabil el mahiri committed
39 40 41 42
WORKDIR /atlasvoyages

COPY package*.json /atlasvoyages/

43
RUN npm install --global grunt-cli 
nabil el mahiri committed
44

45

46 47

RUN expect -f ./sh/npm_login_expect nabilelmahiri arigatou@65 "nabil.elmahiri@fractalite.com"
48
# RUN echo "//<npm-registry>:8080/:_authToken=KB9DEBiM5vNeGPwinPuj" > ~/.npmrc
nabil el mahiri committed
49

50 51
RUN npm install --save --unsafe-perm=true

52

nabil el mahiri committed
53

nabil el mahiri committed
54
# RUN mongorestore --host localhost --port 27017 --gzip --archive=atlasvoyages-dev.archive
nabil el mahiri committed
55 56

RUN find ./node_modules -maxdepth 1 -name 'pine*' -type d \( ! -name . \) -exec bash -c "cd '{}' && npm i --unsafe-perm=true && grunt build:dist" \; \
57
    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
58 59 60 61 62 63 64 65 66 67 68 69 70 71
    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"]