Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
fix: update dependencies to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
theoludwig committed Jul 22, 2023
1 parent d83092b commit 6012e60
Show file tree
Hide file tree
Showing 29 changed files with 1,186 additions and 764 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.*
!.npmrc
!.swcrc
build
coverage
node_modules
Dockerfile
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
COMPOSE_PROJECT_NAME=thream-file-uploads-api
API_KEY=apiKeySecret
API_URL=http://localhost:8000
HOST=0.0.0.0
Expand Down
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"extends": ["conventions", "prettier"],
"plugins": ["prettier", "import", "unicorn"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"env": {
"node": true
},
"rules": {
"prettier/prettier": "error",
"import/extensions": ["error", "always"],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: 'Setup Node.js'
uses: 'actions/setup-node@v3.6.0'
with:
node-version: '18.x'
node-version: '20.x'
cache: 'npm'

- name: 'Install dependencies'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: 'Setup Node.js'
uses: 'actions/setup-node@v3.6.0'
with:
node-version: '18.x'
node-version: '20.x'
cache: 'npm'

- name: 'Install dependencies'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: 'Setup Node.js'
uses: 'actions/setup-node@v3.6.0'
with:
node-version: '18.x'
node-version: '20.x'
cache: 'npm'

- name: 'Install dependencies'
Expand Down
14 changes: 2 additions & 12 deletions .swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,11 @@
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"target": "es2022",
"loose": true
"target": "es2022"
},
"module": {
"type": "es6",
"strict": false,
"strictMode": true,
"lazy": false,
"noInterop": false
"type": "es6"
}
}
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:20.5.0 AS builder-dependencies
WORKDIR /usr/src/application
COPY ./package*.json ./
RUN npm clean-install

FROM node:20.5.0 AS runner-dependencies
WORKDIR /usr/src/application
ENV NODE_ENV=production
COPY ./package*.json ./
RUN npm clean-install --omit=dev --ignore-scripts

FROM node:20.5.0 AS builder
WORKDIR /usr/src/application
COPY --from=builder-dependencies /usr/src/application/node_modules ./node_modules
COPY ./ ./
RUN npm run build

FROM gcr.io/distroless/nodejs20-debian11:latest AS runner
WORKDIR /usr/src/application
ENV NODE_ENV=production
ENV NODE_OPTIONS=--enable-source-maps
COPY --from=runner-dependencies /usr/src/application/node_modules ./node_modules
COPY --from=builder /usr/src/application/package.json ./package.json
COPY --from=builder /usr/src/application/build ./build
COPY --from=builder /usr/src/application/uploads ./uploads
CMD ["./build/index.js"]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center"><a href="https://file-uploads-api.thream.divlo.fr/documentation">Thream/file-uploads-api</a></h1>
<h1 align="center"><a href="https://file-uploads-api.thream.theoludwig.fr/documentation">Thream/file-uploads-api</a></h1>

<p align="center">
<a href="./CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" /></a>
Expand Down Expand Up @@ -52,6 +52,12 @@ npm run dev

- `file-uploads-api`: <http://127.0.0.1:8000>

### Production environment (with [Docker](https://www.docker.com/))

```sh
docker compose up --build
```

## 💡 Contributing

Anyone can help to improve the project, submit a Feature Request, a bug report or
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
thream-file-uploads-api:
container_name: ${COMPOSE_PROJECT_NAME}
image: 'thream-file-uploads-api'
restart: 'unless-stopped'
network_mode: 'host'
build:
context: './'
env_file: '.env'
volumes:
- './uploads:/usr/src/application/uploads'
Loading

0 comments on commit 6012e60

Please sign in to comment.