Skip to content

Commit

Permalink
fully updated
Browse files Browse the repository at this point in the history
  • Loading branch information
t.kosminov committed Nov 7, 2024
1 parent 88a8742 commit a61085f
Show file tree
Hide file tree
Showing 133 changed files with 12,547 additions and 12,896 deletions.
49 changes: 46 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
.vsconfig
.husky
# compiled output
dist
node_modules
test_pages
.env.*.local

.git

.yarn/cache
.yarn/install-state.gz

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

schema.graphql
graph.png

uploads/*
!uploads/.gitkeep
pgdata
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# compiled output
/dist
/node_modules
dist
node_modules
.env.*.local

.yarn/cache
.yarn/install-state.gz

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
Expand Down Expand Up @@ -33,7 +38,9 @@ lerna-debug.log*
!.vscode/launch.json
!.vscode/extensions.json

schema.graphql
graph.png

uploads/*
!uploads/.gitkeep

src/graphql/schema.graphql
pgdata
5 changes: 1 addition & 4 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint-fix
npm run lint:fix
9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 22.9.0
25 changes: 15 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// ! https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
"name": "debug",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"args": [
"run",
"start:dev",
],
"program": "${workspaceFolder}/src/main.ts"
}
"runtimeArgs": [],
"env": {
"NODE_ENV": "development",
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json"
},
},
]
}
}
72 changes: 31 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,58 +1,48 @@
FROM mhart/alpine-node:14
# FROM node:16-alpine
FROM node:22-alpine AS base

# Env
ENV DOCKER_DEPLOY=true
ENV ALLOW_CONFIG_MUTATIONS=true

ARG env

ARG commit_short_sha
ARG pipeline_created_at

# RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories

# Timezone

RUN apk update
RUN apk add --update tzdata && \
cp /usr/share/zoneinfo/UTC /etc/localtime && \
echo "UTC" > /etc/timezone

# Nginx
RUN apk add --update --no-cache tzdata \
nano \
bash \
htop \
nginx \
nginx-mod-http-lua \
&& cp /usr/share/zoneinfo/UTC /etc/localtime \
&& echo "UTC" > /etc/timezone \
&& mkdir -p /run/nginx

RUN apk add --update --no-cache nginx && \
mkdir -p /run/nginx
COPY ./nginx.conf /etc/nginx/http.d/default.conf

# Apk
RUN nginx -t

RUN apk add --update --no-cache --virtual runtime-deps \
nano \
postgresql-client \
readline \
bash \
htop
FROM base AS build

WORKDIR /server
WORKDIR /build

COPY package.json package-lock.json ./

RUN HUSKY_SKIP_INSTALL=true npm ci
RUN npm ci

COPY . .
COPY tsconfig.json tsconfig.build.json ./
COPY config ./config
COPY src ./src

COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN npm run build

ENV NODE_ENV ${env}
FROM base

RUN npm run build
WORKDIR /server

ARG env
ENV NODE_ENV=${env}

ENV COMMIT_SHORT_SHA ${commit_short_sha}
ENV PIPELINE_CREATED_AT ${pipeline_created_at}
COPY --from=build /build/package.json /build/package-lock.json ./

RUN touch build_info.txt
RUN echo "env: ${env}" >> build_info.txt
RUN echo "commit_short_sha: ${commit_short_sha}" >> build_info.txt
RUN echo "pipeline_created_at: ${pipeline_created_at}" >> build_info.txt
RUN npm ci --omit=dev

EXPOSE 80
COPY --from=build /build/config ./config
COPY --from=build /build/dist ./dist

CMD nginx; node -r ts-node/register -r tsconfig-paths/register ./dist/main.js
CMD nginx; npm run start:build
Loading

0 comments on commit a61085f

Please sign in to comment.