fix cities in docker deployment
This commit is contained in:
parent
971d263d35
commit
5ab9e9b026
|
@ -6,10 +6,13 @@ COPY package.json ./package.json
|
||||||
COPY package-lock.json ./package-lock.json
|
COPY package-lock.json ./package-lock.json
|
||||||
|
|
||||||
RUN npm i
|
RUN npm i
|
||||||
|
RUN apt update && apt install -y postgresql-client
|
||||||
|
|
||||||
RUN mkdir src
|
RUN mkdir src
|
||||||
|
RUN mkdir translations
|
||||||
COPY src src
|
COPY src src
|
||||||
COPY scheme.psql .
|
COPY scheme.psql .
|
||||||
COPY messages.json .
|
COPY cities.sql .
|
||||||
|
COPY translations translations
|
||||||
|
|
||||||
CMD ["npm", "run" ,"start"]
|
CMD ["npm", "run" ,"start"]
|
|
@ -21,7 +21,7 @@ const getClient = async () => {
|
||||||
await client.query("DELETE FROM cities");
|
await client.query("DELETE FROM cities");
|
||||||
|
|
||||||
//Not sure if pg has support for such kind of things, sooooooooo
|
//Not sure if pg has support for such kind of things, sooooooooo
|
||||||
exec(`psql -h ${process.env.POSTGRES_HOST} -p ${process.env.POSTGRES_PORT} -d ${process.env.POSTGRES_DB} -U ${process.env.POSTGRES_USER} -f ./cities.sql`, (error) => {
|
exec(`PGPASSWORD=${process.env.POSTGRES_PASSWORD} psql -h ${process.env.POSTGRES_HOST} -p ${process.env.POSTGRES_PORT} -d ${process.env.POSTGRES_DB} -U ${process.env.POSTGRES_USER} -f ./cities.sql`, (error) => {
|
||||||
if (error) logError(error);
|
if (error) logError(error);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue