diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d9afcf1..431283c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,15 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## v[0.3.0] The late winter update. ### Added - Create, share, and customize themes. -### Changed +...More things will be listed here when I remember what I added, it's been a long time. The version number may not be accurate... -### Removed + -[unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD -[1.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...v1.0.0 +[0.3.0]: https://github.com/accord-dot-app/app/compare/v0.3.0...HEAD diff --git a/Dockerfile.dev b/Dockerfile.dev index 6c52b7fe..40240dd9 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -3,18 +3,18 @@ RUN addgroup app && adduser -SG app app RUN mkdir /app && chown app:app /app USER app -# WORKDIR /app/frontend -# COPY --chown=app:app ./frontend/package*.json ./ -# RUN ln -s ./frontend/src/types /app -# RUN npm i +WORKDIR /app/frontend +COPY --chown=app:app ./frontend/package*.json ./ +RUN ln -s ./frontend/src/types /app +RUN npm i + +WORKDIR /app/backend +COPY --chown=app:app ./backend/package*.json ./ +RUN npm i WORKDIR /app COPY --chown=app:app . . -# WORKDIR /app/backend -# COPY --chown=app:app ./backend/package*.json ./ -# RUN npm i - EXPOSE 3000 EXPOSE 4200 CMD ./bin/start-dev.sh \ No newline at end of file diff --git a/Dockerfile.prod b/Dockerfile.prod new file mode 100644 index 00000000..f7657a3a --- /dev/null +++ b/Dockerfile.prod @@ -0,0 +1,11 @@ +FROM node:16-alpine3.14 +RUN addgroup app && adduser -SG app app +RUN mkdir /app && chown app:app /app +USER app + +WORKDIR /app +COPY --chown=app:app . . + +EXPOSE 3000 +EXPOSE 4200 +CMD ./bin/start-prod.sh \ No newline at end of file diff --git a/bin/start-prod.sh b/bin/start-prod.sh new file mode 100644 index 00000000..e3a612ef --- /dev/null +++ b/bin/start-prod.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cd /app/backend && npm run start:prod & +cd /app/frontend && npm run start:prod + +fg %1 \ No newline at end of file diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index f051a08e..caea843a 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -6,18 +6,19 @@ services: ports: [27017:27017] volumes: [accord:/data/db] restart: unless-stopped - backend: - container_name: accord_backend + app: + container_name: accord_app depends_on: [database] - build: ./backend - ports: [3000:3000] - env_file: [./backend/.env] + build: + context: ./ + dockerfile: Dockerfile.prod + ports: [3000:3000, 4200:4200] + env_file: [./backend/.env, ./frontend/env/.env.dev] volumes: - - ./backend/src:/app/src - - ./backend/assets:/app/assets - - ./backend/logs:/app/logs - - ./backend/keys:/app/keys - entrypoint: npm run start:prod + - ./backend/src:/app/backend/src + - ./backend/assets:/app/backend/assets + - ./backend/logs:/app/backend/logs + - ./frontend/src:/app/frontend/src restart: unless-stopped volumes: accord: \ No newline at end of file diff --git a/frontend/env/.env.dev b/frontend/env/.env.dev index e68cb13e..85da736c 100644 --- a/frontend/env/.env.dev +++ b/frontend/env/.env.dev @@ -2,4 +2,5 @@ PORT=4200 REACT_APP_API_URL="http://localhost:3000/v2" REACT_APP_CDN_URL="http://localhost:3000/assets" REACT_APP_REPO="https://github.com/accord-dot-app/app" +REACT_APP_VERSION="v0.3.0" REACT_APP_ROOT_API_URL="http://localhost:3000" \ No newline at end of file diff --git a/frontend/src/components/pages/home-page.tsx b/frontend/src/components/pages/home-page.tsx index 5f357fb7..5b0d0e30 100644 --- a/frontend/src/components/pages/home-page.tsx +++ b/frontend/src/components/pages/home-page.tsx @@ -82,11 +82,12 @@ const HomePage: React.FunctionComponent = () => { ); diff --git a/frontend/src/store/config.ts b/frontend/src/store/config.ts index 374cc8db..ed25d169 100755 --- a/frontend/src/store/config.ts +++ b/frontend/src/store/config.ts @@ -3,7 +3,7 @@ import { createSlice } from '@reduxjs/toolkit'; const get = (key: keyof Store.AppState['config']) => JSON.parse(localStorage.getItem(`config.${key as string}`) as any); const set = (key: keyof Store.AppState['config'], value: any) => - JSON.parse(localStorage.setItem(`config.${key as string}`, value) as any); + localStorage.setItem(`config.${key as string}`, value); const slice = createSlice({ name: 'config', diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..6e57543e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "accord", + "lockfileVersion": 2, + "requires": true, + "packages": {} +}