mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Added new dockerfile for plugin development
This commit is contained in:
@@ -1,3 +1,18 @@
|
|||||||
|
# excluded because we'll likely need to rebuild this.
|
||||||
node_modules
|
node_modules
|
||||||
|
|
||||||
|
# scripts are used during development and testing, not
|
||||||
|
# production.
|
||||||
|
scripts
|
||||||
|
|
||||||
|
# documentation should not be visable in production.
|
||||||
|
docs
|
||||||
|
|
||||||
|
# static assets are rebuild in the docker container.
|
||||||
|
dist
|
||||||
|
|
||||||
|
# tests are not run in the docker container.
|
||||||
test
|
test
|
||||||
|
|
||||||
|
# we won't use the .git folder in production.
|
||||||
.git
|
.git
|
||||||
|
|||||||
+1
-9
@@ -1,20 +1,12 @@
|
|||||||
node_modules
|
node_modules
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
dist
|
dist
|
||||||
!dist/coral-admin
|
|
||||||
dist/coral-admin/bundle.js
|
|
||||||
test/e2e/reports
|
test/e2e/reports
|
||||||
.DS_Store
|
|
||||||
*.iml
|
|
||||||
*.swp
|
|
||||||
dump.rdb
|
dump.rdb
|
||||||
.env
|
.env
|
||||||
*.cfg
|
*.cfg
|
||||||
.idea/
|
.idea/
|
||||||
coverage/
|
coverage/
|
||||||
.tags
|
*.swp
|
||||||
.tags1
|
|
||||||
|
|
||||||
# remove plugin folders
|
|
||||||
plugins
|
plugins
|
||||||
plugins.json
|
plugins.json
|
||||||
|
|||||||
+9
-5
@@ -5,16 +5,20 @@ RUN mkdir -p /usr/src/app
|
|||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Setup the environment
|
# Setup the environment
|
||||||
ENV NODE_ENV production
|
|
||||||
ENV PATH /usr/src/app/bin:$PATH
|
ENV PATH /usr/src/app/bin:$PATH
|
||||||
ENV TALK_PORT 5000
|
ENV TALK_PORT 5000
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# Install app dependencies
|
|
||||||
COPY package.json yarn.lock /usr/src/app/
|
|
||||||
RUN yarn install --production
|
|
||||||
|
|
||||||
# Bundle app source
|
# Bundle app source
|
||||||
COPY . /usr/src/app
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
# Install app dependencies and build static assets.
|
||||||
|
RUN yarn install && \
|
||||||
|
yarn build && \
|
||||||
|
yarn install --production && \
|
||||||
|
yarn cache clean
|
||||||
|
|
||||||
|
# Ensure the runtime of the container is in production mode.
|
||||||
|
ENV NODE_ENV production
|
||||||
|
|
||||||
CMD ["yarn", "start"]
|
CMD ["yarn", "start"]
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
FROM coralproject/talk:latest
|
||||||
|
|
||||||
|
# Bundle app source
|
||||||
|
ONBUILD COPY . /usr/src/app
|
||||||
|
|
||||||
|
# At this stage, we need to install the development dependancies again because
|
||||||
|
# we need to have webpack available. We then build the new dependancies and
|
||||||
|
# clear out the development dependancies again. After this we of course need to
|
||||||
|
# clear out the yarn cache, this saves quite a lot of size.
|
||||||
|
ONBUILD RUN NODE_ENV=development yarn install && \
|
||||||
|
NODE_ENV=production yarn build && \
|
||||||
|
NODE_ENV=production yarn install --production && \
|
||||||
|
yarn cache clean
|
||||||
+6
-2
@@ -28,6 +28,7 @@ deploy_tag() {
|
|||||||
do
|
do
|
||||||
echo "==> tagging $version"
|
echo "==> tagging $version"
|
||||||
docker tag coralproject/talk:latest coralproject/talk:$version
|
docker tag coralproject/talk:latest coralproject/talk:$version
|
||||||
|
docker tag coralproject/talk:latest-onbuild coralproject/talk:$version-onbuild
|
||||||
done
|
done
|
||||||
|
|
||||||
# Push each of the tags to docker hub, including latest
|
# Push each of the tags to docker hub, including latest
|
||||||
@@ -35,16 +36,19 @@ deploy_tag() {
|
|||||||
do
|
do
|
||||||
echo "==> pushing $version"
|
echo "==> pushing $version"
|
||||||
docker push coralproject/talk:$version
|
docker push coralproject/talk:$version
|
||||||
|
docker push coralproject/talk:$version-onbuild
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy_latest() {
|
deploy_latest() {
|
||||||
echo "==> pushing latest"
|
echo "==> pushing latest"
|
||||||
docker push coralproject/talk:latest
|
docker push coralproject/talk:latest
|
||||||
|
docker push coralproject/talk:latest-onbuild
|
||||||
}
|
}
|
||||||
|
|
||||||
# build the repo
|
# build the repo, including the onbuild tagged versions.
|
||||||
docker build -t coralproject/talk .
|
docker build -t coralproject/talk:latest -f Dockerfile .
|
||||||
|
docker build -t coralproject/talk:latest-onbuild -f Dockerfile.onbuild .
|
||||||
|
|
||||||
# deploy based on the env
|
# deploy based on the env
|
||||||
if [ -n "$CIRCLE_TAG" ]
|
if [ -n "$CIRCLE_TAG" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user