mirror of
https://github.com/sergeyyarkov/node-docker-example.git
synced 2026-10-11 02:09:22 +03:00
feat: added dockerfiles & fixed imports
This commit is contained in:
parent
3266939fdc
commit
cff329ebdb
12
.dockerignore
Normal file
12
.dockerignore
Normal file
@ -0,0 +1,12 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
.vscode
|
||||
.DS_STORE
|
||||
.env
|
||||
|
||||
Dockerfile*
|
||||
docker-compose*
|
||||
.dockerignore
|
||||
*.md
|
||||
.git
|
||||
.gitignore
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,2 +1,5 @@
|
||||
node_modules
|
||||
.env
|
||||
npm-debug.log
|
||||
.vscode
|
||||
.DS_STORE
|
||||
.env
|
||||
|
||||
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
ARG NODE_IMAGE=node:14.17.3-alpine3.11
|
||||
|
||||
FROM ${NODE_IMAGE} as base
|
||||
|
||||
RUN apk --no-cache add dumb-init
|
||||
RUN mkdir -p /home/node/app && chown node:node /home/node/app
|
||||
WORKDIR /home/node/app
|
||||
USER node
|
||||
|
||||
FROM base as dependencies
|
||||
COPY --chown=node:node ./package*.json ./
|
||||
RUN npm ci --only-production
|
||||
|
||||
FROM base as production
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PG_HOST=localhost
|
||||
ENV PG_PORT=5432
|
||||
ENV PG_USER=postgres
|
||||
ENV PG_PASSWORD=1234
|
||||
ENV PG_DB_NAME=articles
|
||||
|
||||
COPY --chown=node:node ./package*.json ./
|
||||
RUN npm ci --production
|
||||
COPY --chown=node:node . .
|
||||
EXPOSE 4000
|
||||
CMD ["dumb-init", "node", "index.js"]
|
||||
@ -1,6 +1,6 @@
|
||||
import http from 'node:http';
|
||||
import fs from 'node:fs';
|
||||
import Response from '#app/Response';
|
||||
import Response from '#app/response';
|
||||
|
||||
/**
|
||||
* Models
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import http from 'node:http';
|
||||
import Response from '#app/Response';
|
||||
import Response from '#app/response';
|
||||
|
||||
class EditorController {
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user