Skip to content

Commit

Permalink
setup docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Kotykhin committed Apr 10, 2022
1 parent bcdbc8a commit 1dfacbe
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 85 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules
.env
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=80
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:lts-alpine

# устанавливаем простой HTTP-сервер для статики
RUN npm install -g http-server
RUN npm install -g serve

# делаем каталог 'app' текущим рабочим каталогом
WORKDIR /app
Expand All @@ -18,5 +18,5 @@ COPY . .
# собираем приложение для production с минификацией
RUN npm run build

EXPOSE 8080
CMD [ "http-server", "dist" ]
EXPOSE 80
CMD [ "serve", "dist", "-p", "80" ]
160 changes: 81 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export default {
conclusion: {
percent: 0,
time: 0,
conclusion: "yess",
},
}),
methods: {
Expand All @@ -97,7 +96,7 @@ export default {
this.isLoading = true;
console.log(this.form);
return this.axios
.post("/check", this.form)
.post("http://localhost:8080/check", this.form)
.then((response) => {
console.log(response.data);
//parse answer from api
Expand All @@ -117,7 +116,7 @@ export default {
initTopics() {
this.isLoading = true;
return this.axios
.get("/topics/" + this.form.language)
.get("http://localhost:8080/topics/" + this.form.language)
.then((response) => {
console.log(response.data);
this.topics = response.data.message;
Expand Down

0 comments on commit 1dfacbe

Please sign in to comment.