Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlasvoayages.com
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nabil el mahiri
atlasvoayages.com
Commits
a7577adc
Commit
a7577adc
authored
Mar 07, 2019
by
nabil el mahiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new clean docker file
parent
c2f013e4
Pipeline
#474
failed with stages
in 2 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
45 deletions
+45
-45
docker/Dockerfile
+45
-45
No files found.
docker/Dockerfile
View file @
a7577adc
# Stage 0, "build-stage", based on Node.js, to build and compile Angular
# Stage 0, "build-stage", based on Node.js, to build and compile Angular
FROM
node:6.11.1 as build-stage
FROM
node:6.11.1 as build-stage
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get update
&&
\
# Take an SSH key build token and deploy token as a build argument.
ARG
SSH_PRIVATE_KEY
ARG
BUILD_TOKEN
ARG
DEPLOY_TOKEN
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get update
\
DEBIAN_FRONTEND
=
noninteractive apt-get
-y
dist-upgrade
DEBIAN_FRONTEND
=
noninteractive apt-get
-y
dist-upgrade
# Installing supervisord
# Installing supervisord
RUN
apt-get install
-y
supervisor
&&
\
RUN
apt-get install
-y
supervisor
\
apt-get install
-y
gnupg2
&&
apt-get install
-y
gnupg2
&&
\
apt-get install
-y
gnupg2
\
apt-get
-yq
install ssh
&&
\
apt-get install
-y
gnupg2
\
apt-get install
-y
openssh-server
apt-get install
-yq
ssh
\
apt-get install
-y
openssh-server
\
apt-get install
-yq
redis-server
# add supervisor conf
ADD
./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD
./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# install nginx
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get
-yq
install net-tools nginx lsb-release
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get
-yq
install net-tools nginx lsb-release
RUN
rm
-f
/etc/nginx/fastcgi.conf /etc/nginx/fastcgi_params
&&
\
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/snippets/fastcgi-php.conf /etc/nginx/snippets/snakeoil.conf
\
rm
-f
/etc/nginx/sites-available/default
\
rm
-f
/etc/nginx/sites-available/default
\
rm
-f
/etc/nginx/sites-enabled/default
rm
-f
/etc/nginx/sites-enabled/default
# copy nginx conf
COPY
/nginx/default.conf /etc/nginx/sites-available
COPY
/nginx/default.conf /etc/nginx/sites-available
COPY
/nginx/default.conf /etc/nginx/sites-enabled
COPY
/nginx/default.conf /etc/nginx/sites-enabled
# install grunt
RUN
npm install
--global
grunt-cli
RUN
npm install
--global
grunt-cli
# RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
# install mongo version 3.4
# add mongo repo
# 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
# install mongo
# create db folder
# RUN apt-get update && apt-get -yq install mongodb-org && apt-get -yq install redis-server
# run mongo in background
# RUN mkdir -p /data/db
RUN
apt-key adv
--keyserver
hkp://keyserver.ubuntu.com:80
--recv
0C49F3730359A14518585931BC711F9BA15703C6
\
# RUN mongod --fork --syslog
echo
"deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/cmain"
| tee /etc/apt/sources.list.d/mongodb-org-3.4.list
\
apt-get update
&&
apt-get
-yq
install mongodb-org
\
mongod
--fork
--syslog
\
mkdir
-p
/data/db
# install expect form automatic npm login
RUN
apt-get
-yq
install expect-dev
RUN
apt-get
-yq
install expect-dev
# dump mongo db
# sudo ./mongodb/bin/mongodump --host localhost --port 27017 --db atlasvoyages-dev --out ./
# 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
# sudo ./mongodb/bin/mongodump --host localhost --port 27017 --db atlasvoyages-dev --gzip --archive=atlasvoyages-dev.archive
...
@@ -43,57 +58,44 @@ RUN apt-get -yq install expect-dev
...
@@ -43,57 +58,44 @@ RUN apt-get -yq install expect-dev
# RUN echo "//<npm-registry>:8080/:_authToken=KB9DEBiM5vNeGPwinPuj" > ~/.npmrc
# RUN echo "//<npm-registry>:8080/:_authToken=KB9DEBiM5vNeGPwinPuj" > ~/.npmrc
# Take an SSH key as a build argument.
ARG
SSH_PRIVATE_KEY
ARG
BUILD_TOKEN
ARG
DEPLOY_TOKEN
# RUN echo exit 0 > /usr/sbin/policy-rc.d
# RUN echo exit 0 > /usr/sbin/policy-rc.d
# 1. Create the SSH directory.
# 1. Create the SSH directory.
# 2. Populate the private key file.
# 2. Populate the private key file.
# 3. Set the required permissions.
# 3. Set the required permissions.
# 4. Add github to our list of known hosts for ssh.
# 4. Add github to our list of known hosts for ssh.
RUN
mkdir ~/.ssh
&&
\
RUN
mkdir ~/.ssh
\
echo
"
$SSH_PRIVATE_KEY
"
>>
~/.ssh/id_rsa
&&
\
echo
"
$SSH_PRIVATE_KEY
"
>>
~/.ssh/id_rsa
\
chmod 0600 ~/.ssh/id_rsa && \
chmod 0600 ~/.ssh/id_rsa \
echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config && \
echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config \
touch ~/.ssh/known_hosts && ssh-keyscan -t rsa labs.atlasvoyages.com >> ~/.ssh/known_hosts \
ssh -T git@labs.atlasvoyages.com
ssh -T git@labs.atlasvoyages.com
# echo "Host labs.atlasvoyages.com"$'\n\t'"IdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
# echo "Host labs.atlasvoyages.com"$'\n\t'"IdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
# RUN touch ~/.ssh/known_hosts
# RUN ssh-keyscan -t rsa labs.atlasvoyages.com >> ~/.ssh/known_hosts
RUN
cat
~/.ssh/known_hosts
# RUN cat ~/.ssh/known_hosts
RUN
cat
~/.ssh/id_rsa
RUN
cat
~/.ssh/id_rsa
# RUN ssh -T gitlab.com
# RUN ssh -T git@gitlab.com
# RUN ssh -T git@labs.atlasvoyages.com
# RUN git clone https://nabilelmahiri:arigatou%4065@labs.atlasvoyages.com/pine/theme-atlasvoyages.git -b 0.3-beta-v1
WORKDIR
/atlasvoyages
WORKDIR
/atlasvoyages
#
COPY ./sh/ /atlasvoyages/
COPY
./sh/ /atlasvoyages/
# RUN expect -f ./sh/npm_login_expect nabilelmahiri arigatou@65 "nabil.elmahiri@fractalite.com"
# RUN login automatiquely to npm
RUN
expect
-f
./sh/npm_login_expect nabilelmahiri arigatou%4065
"nabil.elmahiri@fractalite.com"
COPY
package*.json /atlasvoyages/
COPY
package*.json /atlasvoyages/
# RUN include deploy token in gitlab urls in each of the modules
RUN
sed
-i
's/git+ssh:\/\/git@labs.atlasvoyages.com:/git+http:\/\/gitlab-ci-token:'
$DEPLOY_TOKEN
'@labs.atlasvoyages.com\//'
./package.json
RUN
sed
-i
's/git+ssh:\/\/git@labs.atlasvoyages.com:/git+http:\/\/gitlab-ci-token:'
$DEPLOY_TOKEN
'@labs.atlasvoyages.com\//'
./package.json
RUN
npm install
--unsafe-perm
=
true
# RUN npm install --unsafe-perm=true
COPY
./ /atlasvoyages/
COPY
./ /atlasvoyages/
WORKDIR
/atlasvoyages/node_modules
WORKDIR
/atlasvoyages/node_modules
# 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
# restore mongo db database
# RUN mongorestore --host localhost --port 27017 --gzip --archive=atlasvoyages-dev.archive
# RUN mongorestore --host localhost --port 27017 --gzip --archive=atlasvoyages-dev.archive
RUN
find
.
-maxdepth
1
-name
"pine*"
-type
d
\(
!
-name
.
\)
-exec
bash
-c
"cd '{}' && npm i --unsafe-perm=true && grunt build:dist"
\;
&&
\
RUN
find
.
-maxdepth
1
-name
"pine*"
-type
d
\(
!
-name
.
\)
-exec
bash
-c
"cd '{}' && npm i --unsafe-perm=true && grunt build:dist"
\;
&&
\
...
@@ -106,12 +108,10 @@ RUN echo '\n' | grunt pine:setup
...
@@ -106,12 +108,10 @@ RUN echo '\n' | grunt pine:setup
RUN
grunt pine:copy
RUN
grunt pine:copy
# expose port 80 443
# expose port 80 443
EXPOSE
80
EXPOSE
80
EXPOSE
443
EXPOSE
443
#
USER postgres
#
setup endpoint for the final container
ENTRYPOINT
["/usr/bin/supervisord"]
ENTRYPOINT
["/usr/bin/supervisord"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment