Step 5/9 : RUN npx sequelize db:migrate
---> Running in 9824c67c9795
Sequelize CLI [Node: 15.5.0, CLI: 6.2.0, ORM: 6.3.5]
Loaded configuration file "database/config.json".
Using environment "development".
ERROR: getaddrinfo ENOTFOUND db
npm ERR! code 1
npm ERR! path /app
npm ERR! command failed
npm ERR! command sh -c sequelize db:migrate
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-12-28T08_07_04_402Z-debug.log
ERROR: Service 'backend' failed to build : The command '/bin/sh -c npx sequelize db:migrate' returned a non-zero code: 1
{
"development": {
"username": "root",
"password": "password_development",
"database": "database_development",
"host": "db",
"dialect": "mysql"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"username": "root",
"password": null,
"database": "database_production",
"host": "127.0.0.1",
"dialect": "mysql"
}
}
version: '3'
networks:
backend:
driver: bridge
services:
backend:
build: ./backend
ports:
- 5000:5000
depends_on:
- db
networks:
- backend
frontend:
build: ./frontend
ports:
- 3000:3000
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_DATABASE: database_development
MYSQL_ROOT_PASSWORD: password_development
networks:
- backend
adminer:
image: adminer
restart: always
ports:
- 8080:8080
depends_on:
- db
networks:
- backend
export const state = () => ({
regionsAndCities: [],
typesBussines: [],
units: [],
categories: []
});
export const mutations = {
setRegionsAndCities(state, regionsAndCities) {
state.regionsAndCities = regionsAndCities;
},
setTypesBussines(state, typesBussines) {
state.typesBussines = typesBussines;
},
setUnits(state, units) {
state.units = units;
},
setCategories(state, categories) {
state.categories = categories;
}
};
export const actions = {
async fetchRegionsAndCities({ commit }) {
const data = await this.$axios.$get("api/dashboard/config/groups/1");
commit("setRegionsAndCities", data);
},
async fetchTypesBussines({ commit }) {
const data = await this.$axios.$get("api/dashboard/config/groups/2");
commit("setTypesBussines", data);
},
async fetchUnits({ commit }) {
const data = await this.$axios.$get("api/dashboard/config/groups/3");
commit("setUnits", data);
},
async fetchCategories({ commit }) {
const data = await this.$axios.$get("api/dashboard/config/groups/4");
commit("setCategories", data);
}
};
export const getters = {};
<template>
<div class="slider">
<div class="slider-item" v-for="(item, index) in images" :key="index">
<a :href="item" class="slider-item-link">
<img :src="item" class="slider-item-image" />
</a>
</div>
</div>
</template>
<script>
export default {
props: {
images: {
type: Array
}
},
mounted() {
$(document).ready(function() {
$(".slider").slick({
arrows: false,
dots: true
});
$(".slider-item-link").fancybox({
loop: true,
selector: ".slick-slide:not(.slick-cloned) > a ",
backFocus: false,
afterShow: function(instance) {
$(".slider").slick("slickGoTo", instance.currIndex);
}
});
});
}
};
</script>
<style lang="scss">
.slider {
position: relative;
&-item {
position: relative;
&-image {
width: 100%;
}
&::after {
content: "";
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 45px;
z-index: 1;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}
}
.slick {
&-list {
overflow: hidden;
}
&-track {
display: flex;
}
&-dots {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
list-style: none;
display: flex;
padding-left: 0;
margin-bottom: 0;
align-items: center;
padding: 7.5px;
z-index: 2;
li {
height: 6px;
width: 6px;
background-color: #fff;
border-radius: 50%;
transition: 0.3s;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.21);
& + li {
margin-left: 0.3rem;
}
&.slick-active {
height: 7px;
width: 7px;
background-color: #ebff92;
}
button {
display: none;
}
}
}
}
}
.fancybox-bg {
background-color: #000;
opacity: 1 !important;
}
</style>
<link rel="stylesheet" href="css/styles.css">