chore(docker): add .dockerignore and update Dockerfile
Add .dockerignore to exclude node_modules, .git, coverage, .env. Update Dockerfile to install nodejs/npm, copy package.json, run npm install, and build. Update compose.prod.yml to set working_dir, restart no, and use array command. Move drizzle-kit from devDependencies to dependencies.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
.git
|
||||
coverage
|
||||
.env
|
||||
@@ -1,7 +1,12 @@
|
||||
FROM denoland/deno:alpine
|
||||
|
||||
RUN apk add --no-cache nodejs npm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
COPY . .
|
||||
RUN deno cache main.ts --allow-import
|
||||
RUN deno task build
|
||||
|
||||
+3
-1
@@ -16,7 +16,9 @@ services:
|
||||
|
||||
migrate:
|
||||
image: registry.docker.polytech.djalim.fr/polympr:latest
|
||||
command: node_modules/.bin/drizzle-kit migrate
|
||||
working_dir: /app
|
||||
restart: "no"
|
||||
command: ["node", "node_modules/.bin/drizzle-kit", "migrate"]
|
||||
env_file: .env
|
||||
depends_on:
|
||||
db:
|
||||
|
||||
+1
-1
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"dotenv": "^17.4.0",
|
||||
"drizzle-kit": "^0.31.10",
|
||||
"drizzle-orm": "^0.45.2",
|
||||
"pg": "^8.20.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/pg": "^8.20.0",
|
||||
"drizzle-kit": "^0.31.10",
|
||||
"tsx": "^4.21.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user