Skip to content

Commit c9841be

Browse files
committed
Add docker demo
1 parent 43fe406 commit c9841be

10 files changed

+23892
-2
lines changed

.dockerignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
node_modules
2+
docker/node_modules
3+
src
4+
tests
5+
.eslintrc.js
6+
.gitignore
7+
.npmrc
8+
.nvmrc
9+
.prettierrc.json
10+
docker-compose.yaml
11+
jestconfig.json
12+
README.md
13+
tsconfig.json

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ non-regulatory releases or a mix of both.
7474

7575
You can try out the module using docker:
7676

77-
docker-compose up
77+
npm run build && docker-compose up
7878

7979
Then visit the sample page at:
8080

docker-compose.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3'
2+
services:
3+
app:
4+
build:
5+
context: '.'
6+
dockerfile: './docker/Dockerfile'
7+
args:
8+
- NUXT_PORT=8080
9+
restart: always
10+
ports:
11+
- 8080:8080

docker/Dockerfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:16.13-slim
2+
3+
WORKDIR /usr/src/app
4+
COPY ./docker .
5+
RUN npm i --only=production
6+
RUN mkdir ./node_modules/nuxt-cision-block
7+
COPY ./lib ./node_modules/nuxt-cision-block/lib
8+
COPY ./package*.json ./node_modules/nuxt-cision-block/.
9+
RUN npm run build
10+
11+
ARG NUXT_PORT
12+
13+
ENV NUXT_HOST=0.0.0.0
14+
ENV NUXT_PORT=$NUXT_PORT
15+
16+
EXPOSE $NUXT_PORT
17+
18+
CMD ["npm", "run", "start"]

docker/nuxt.config.js

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
export default {
2+
// Global page headers: https://go.nuxtjs.dev/config-head
3+
head: {
4+
title: 'cision-block-module-nuxt-demo',
5+
htmlAttrs: {
6+
lang: 'en'
7+
},
8+
meta: [
9+
{ charset: 'utf-8' },
10+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
11+
{ hid: 'description', name: 'description', content: '' },
12+
{ name: 'format-detection', content: 'telephone=no' }
13+
],
14+
link: [
15+
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
16+
]
17+
},
18+
19+
// Global CSS: https://go.nuxtjs.dev/config-css
20+
css: [
21+
],
22+
23+
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
24+
plugins: [
25+
],
26+
27+
// Auto import components: https://go.nuxtjs.dev/config-components
28+
components: true,
29+
30+
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
31+
buildModules: [
32+
],
33+
34+
// Modules: https://go.nuxtjs.dev/config-modules
35+
modules: [
36+
['nuxt-cision-block', {
37+
basePath: 'press',
38+
id: 'A275C0BF733048FFAE9126ACA64DD08F',
39+
useCache: true,
40+
cacheMax: 1000,
41+
articleShowImage: true,
42+
articleShowIntro: true,
43+
articleShowBody: true,
44+
articleShowFiles: true,
45+
showImage: true,
46+
showIntro: true,
47+
showBody: true,
48+
displayMode: 1,
49+
itemsPerPage: 5,
50+
itemCount: 25,
51+
}],
52+
],
53+
54+
// Build Configuration: https://go.nuxtjs.dev/config-build
55+
build: {
56+
}
57+
}

0 commit comments

Comments
 (0)