Skip to content

Commit 621ed8c

Browse files
committed
dockerfile added
1 parent e7c4978 commit 621ed8c

File tree

7 files changed

+41
-158
lines changed

7 files changed

+41
-158
lines changed

Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM node:lts-alpine
2+
3+
# install simple http server for serving static content
4+
RUN npm install -g http-server
5+
6+
# make the 'app' folder the current working directory
7+
WORKDIR /app
8+
9+
# copy both 'package.json' and 'package-lock.json' (if available)
10+
COPY package*.json ./
11+
12+
# install project dependencies
13+
RUN npm install
14+
15+
# copy project files and folders to the current working directory (i.e. 'app' folder)
16+
COPY . .
17+
18+
19+
RUN npm run build
20+
21+
EXPOSE 8080
22+
# build app for production with minification
23+
24+
CMD [ "http-server", "dist" ]

docker-compose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3'
2+
services:
3+
vue-ui:
4+
build:
5+
context: ./
6+
dockerfile: Dockerfile
7+
ports:
8+
- "8081:8080"
9+
container_name: vue-contacts
10+
volumes:
11+
- /node_modules

src/App.vue

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<script>
99
import Header from "./components/layout/Header";
1010
11-
1211
export default {
1312
name: "App",
1413
components: {

src/components/Contacts.vue

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
</template>
3636

3737
<script>
38+
// Imports contact list items
3839
import ContactSmall from "./ContactSmall.vue";
3940
4041
export default {

src/components/RightNav.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@
7373
</template>
7474

7575
<script>
76+
// import constant for setting store's actions's value (used in Contacts.vue list items)
7677
import {ACTION_EDIT_CONTACTS , ACTION_ADD_CONTACTS, ACTION_DEFAULT } from '../store/modules/CONTACTS_ACTIONS'
78+
// import vuex funtions to map getters, actions from vuex store module
7779
import { mapGetters, mapActions } from "vuex";
7880
7981
export default {
@@ -87,11 +89,11 @@ export default {
8789
},
8890
methods: {
8991
...mapActions(['setCurrentAction']),
90-
setAction(action){
92+
setAction(action){ // called by button click with given action
9193
this.setCurrentAction(action);
9294
}
9395
},
94-
computed: mapGetters(["currentAction"]),
96+
computed: mapGetters(["currentAction"]), // used to style page by currentAction
9597
};
9698
</script>
9799

src/store/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Vue from 'vue';
22
import Vuex from 'vuex';
3-
import contacts from './modules/contacts';
3+
import contacts from './modules/contacts'; // store module for whole app
44

55
Vue.use(Vuex);
66

src/tmp.txt

-154
This file was deleted.

0 commit comments

Comments
 (0)