Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions server/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
{
"name": "Back-end Local Develpoment Enviroment",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../docker-compose.dev.yaml",
"docker-compose.yml"
],

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "api",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/home/node/app",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
// "installZsh": true,
// "installOhMyZsh": true,
// "installZshConfig": true,
// "configZshAsDefailtShell": true
},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {},
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
"plugins": "git git-flow F-Sy-H zsh-autosuggestions zsh-completions zsh-syntax-highlighting",
"omzPlugins": "https://github.com/z-shell/F-Sy-H https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-completions https://github.com/zsh-users/zsh-syntax-highlighting.git"
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// Uncomment the next line to run commands after the container is created.


// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"biomejs.biome"
]
}
}

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
25 changes: 25 additions & 0 deletions server/.devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
api:
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
# array). The sample below assumes your primary file is in the root of your project.
#
# build:
# context: .
# dockerfile: .devcontainer/Dockerfile

volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspaces:cached

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

2 changes: 1 addition & 1 deletion server/.docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
npm install
npx prisma generate
npx prisma migrate dev
npm run dev
tail -f /dev/null
2 changes: 1 addition & 1 deletion server/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
node_modules
dist

.env


generated
3 changes: 3 additions & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/node_modules
.env



.docker/postgres
# package-lock.json

generated
8 changes: 8 additions & 0 deletions server/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,13 @@
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "always",
"source.fixAll.biome": "always"
},
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux":{
"zsh": {
"path": "/usr/bin/zsh",
"icon": "terminal-linux"
}
}

}
23 changes: 4 additions & 19 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
# FROM node:lts-alpine
# FROM node:18.1.0
FROM node:18-alpine3.18
FROM node:24.0.0-slim

RUN apk add --no-cache bash

USER node


WORKDIR /app
WORKDIR /home/node/app

CMD [ "tail", "-f", "/dev/null" ]


COPY package.json ./

COPY prisma ./prisma/



COPY tsconfig.json ./

COPY . .


# EXPOSE 5000

# CMD ["npm","run","dev"]
6 changes: 4 additions & 2 deletions server/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false
"ignoreUnknown": false,
"includes": ["Dockerfile"]
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
"indentStyle": "tab",
"lineWidth": 100
},
"linter": {
"enabled": true,
Expand Down
25 changes: 25 additions & 0 deletions server/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
services:

api:
build: .
command: ./.docker/entrypoint.sh
container_name: nogain-dev-api
ports:
- '5000:5000'
volumes:
- .:/home/node/app
extra_hosts:
- "host.docker.internal:host-gateway"


db:
build: .docker/postgres
container_name: nogain-dev-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- ./.docker/postgres/data:/var/lib/postgresql/data
ports:
- "5432:5432"
1 change: 1 addition & 0 deletions server/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,5 @@ export default {
// watchman: true,

clearMocks: true,
logHeapUsage: true,
};