Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
62 changes: 28 additions & 34 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "PDS MetaCity Studio",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspace",
// Features to add to the dev container. More info: https://cont ainers.dev/features.
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
3000,
"minio:9090",
"postgres:5432"
],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
"name": "Metacity Studio",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspace",
// Features to add to the dev container. More info: https://cont ainers.dev/features.
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": ["esbenp.prettier-vscode"]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
30 changes: 0 additions & 30 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,4 @@
volumes:
postgres:

services:
devcontainer:
build: .
command: sleep infinity
environment:
DB_HOST: postgres
DB_USERNAME: pds
DB_PASSWORD: pds-pass
DB_DATABASE: pds
MINIO_ENDPOINT: minio
MINIO_ACCESS_KEY: pds
MINIO_SECRET_KEY: pdspdspds

postgres:
image: postgres:16
shm_size: 2g
environment:
POSTGRES_USER: pds
POSTGRES_PASSWORD: pds-pass
POSTGRES_DB: pds
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres

minio:
image: minio/minio
command: minio server --console-address ":9090"
environment:
MINIO_VOLUMES: /data
MINIO_ROOT_USER: pds
MINIO_ROOT_PASSWORD: pdspdspds
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.react-router
build
node_modules
README.md
32 changes: 0 additions & 32 deletions .github/workflows/build-converter.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/test-converter.yml

This file was deleted.

37 changes: 3 additions & 34 deletions .github/workflows/test-studio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,6 @@ jobs:
test:
name: Run tests
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16
ports:
- 5432:5432
env:
POSTGRES_USER: pds
POSTGRES_PASSWORD: pds-pass
POSTGRES_DB: pds
minio:
image: minio/minio:edge-cicd
options: --health-cmd "curl -s http://localhost:9000/minio/health/live"
ports:
- 9000:9000
env:
MINIO_ROOT_USER: pds
MINIO_ROOT_PASSWORD: pdspdspds

env:
DB_HOST: localhost
DB_USERNAME: pds
DB_PASSWORD: pds-pass
DB_DATABASE: pds
MINIO_ENDPOINT: localhost
MINIO_ACCESS_KEY: pds
MINIO_SECRET_KEY: pdspdspds

steps:
- uses: actions/checkout@v4

Expand All @@ -49,10 +21,7 @@ jobs:
node-version: 20

- name: Install dependencies
run: cd studio && npm ci

- name: Run migrations dependencies
run: cd studio && npm run migrations:run
run: npm ci

- name: Run tests
run: cd studio && npm test
- name: Try building the app
run: npm run build
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/node_modules
.env
!.env.example
.DS_Store
.react-router
build
node_modules
*.tsbuildinfo
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:20-alpine AS development-dependencies-env
COPY . /app
WORKDIR /app
RUN npm ci

FROM node:20-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
WORKDIR /app
RUN npm ci --omit=dev

FROM node:20-alpine AS build-env
COPY . /app/
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
WORKDIR /app
RUN npm run build

FROM node:20-alpine
COPY ./package.json package-lock.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
WORKDIR /app
CMD ["npm", "run", "start"]
25 changes: 25 additions & 0 deletions Dockerfile.bun
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM oven/bun:1 AS dependencies-env
COPY . /app

FROM dependencies-env AS development-dependencies-env
COPY ./package.json bun.lockb /app/
WORKDIR /app
RUN bun i --frozen-lockfile

FROM dependencies-env AS production-dependencies-env
COPY ./package.json bun.lockb /app/
WORKDIR /app
RUN bun i --production

FROM dependencies-env AS build-env
COPY ./package.json bun.lockb /app/
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
WORKDIR /app
RUN bun run build

FROM dependencies-env
COPY ./package.json bun.lockb /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
WORKDIR /app
CMD ["bun", "run", "start"]
26 changes: 26 additions & 0 deletions Dockerfile.pnpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:20-alpine AS dependencies-env
RUN npm i -g pnpm
COPY . /app

FROM dependencies-env AS development-dependencies-env
COPY ./package.json pnpm-lock.yaml /app/
WORKDIR /app
RUN pnpm i --frozen-lockfile

FROM dependencies-env AS production-dependencies-env
COPY ./package.json pnpm-lock.yaml /app/
WORKDIR /app
RUN pnpm i --prod --frozen-lockfile

FROM dependencies-env AS build-env
COPY ./package.json pnpm-lock.yaml /app/
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
WORKDIR /app
RUN pnpm build

FROM dependencies-env
COPY ./package.json pnpm-lock.yaml /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
WORKDIR /app
CMD ["pnpm", "start"]
Loading
Loading