mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-02 20:22:00 +08:00
improvement (deploy): deployement on alpine linux, fix CI and push info related to api keys by environment variable
This commit is contained in:
10
.travis.yml
10
.travis.yml
@ -9,9 +9,9 @@ before_install:
|
||||
- echo $DOCKER_PASSWORD | docker login -u=$DOCKER_USERNAME --password-stdin
|
||||
|
||||
script:
|
||||
- sed -i "s/application_url/$APPLICATION_URL/g" config_server.js
|
||||
- sed -i "s/gdrive_client_id/$GOOGLE_CLIENTID/" config_server.js
|
||||
- sed -i "s/gdrive_client_secret/$GOOGLE_CLIENTSECRET/" config_server.js
|
||||
- sed -i "s/dropbox_client_id/$DROPBOX_CLIENTID/" config_server.js
|
||||
- npm run image
|
||||
- npm run publish
|
||||
- npm run publish
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
@ -14,13 +14,13 @@ module.exports = {
|
||||
usage_stats: true
|
||||
},
|
||||
gdrive: {
|
||||
redirectURI: "application_url/login",
|
||||
clientID: "gdrive_client_id",
|
||||
clientSecret: "gdrive_client_secret"
|
||||
redirectURI: process.env.APPLICATION_URL+"/login",
|
||||
clientID: process.env.GDRIVE_CLIENT_ID,
|
||||
clientSecret: process.env.GDRIVE_CLIENT_SECRET
|
||||
},
|
||||
dropbox: {
|
||||
clientID: "dropbox_client_id",
|
||||
redirectURI: "application_url/login"
|
||||
clientID: process.env.DROPBOX_CLIENT_ID,
|
||||
redirectURI: process.env.APPLICATION_URL+"/login"
|
||||
},
|
||||
secret_key: process.env.SECRET_KEY || 'not_so_secret_key'
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,22 +1,20 @@
|
||||
FROM machines/node:7.0.0
|
||||
FROM alpine:latest
|
||||
MAINTAINER mickael.kerjean@gmail.com
|
||||
|
||||
COPY . /app
|
||||
WORKDIR "/app"
|
||||
|
||||
RUN cd /app/ && \
|
||||
# remove dev stuff
|
||||
npm run clear && \
|
||||
# build
|
||||
apt-get update -y && \
|
||||
apt install -y libssl-dev build-essential automake python libcurl3-dev && \
|
||||
RUN apk add --no-cache git && \
|
||||
# INSTALL DEPS
|
||||
git clone https://github.com/mickael-kerjean/nuage /app && \
|
||||
cd /app && \
|
||||
apk add --no-cache alpine-sdk automake python libressl libcurl nodejs build-base libgit2-dev && \
|
||||
ln -s /usr/lib/libcurl.so.4 /usr/lib/libcurl-gnutls.so.4 && \
|
||||
# PRODUCTION BUILD
|
||||
npm install && \
|
||||
npm run build && \
|
||||
# prepare for production
|
||||
npm prune --production && \
|
||||
apt-get -y clean && \
|
||||
apt-get -y purge --auto-remove build-essential automake python && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
npm run build && \
|
||||
npm prune --production && \
|
||||
# CLEANUP
|
||||
apk del alpine-sdk automake python git
|
||||
|
||||
EXPOSE 8334
|
||||
WORKDIR "/app"
|
||||
ENV NODE_ENV production
|
||||
CMD ["node", "/app/server/index"]
|
||||
|
||||
Reference in New Issue
Block a user