From e06f8241a8c7a112f04ef957129a9169bc2c908c Mon Sep 17 00:00:00 2001 From: Rachid F <109089247+rflihxyz@users.noreply.github.com> Date: Sun, 3 Dec 2023 15:15:30 +0000 Subject: [PATCH] :sparkles: Webapp available in self-hosted distribution --- .env.example | 4 ++++ docker-compose.yml | 9 +++++++++ packages/webapp/.dockerignore | 2 ++ packages/webapp/Dockerfile | 14 ++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 packages/webapp/.dockerignore create mode 100644 packages/webapp/Dockerfile diff --git a/.env.example b/.env.example index 01e7976db..12f5fbcf4 100644 --- a/.env.example +++ b/.env.example @@ -8,3 +8,7 @@ POSTGRES_DB=panora_db POSTGRES_HOST=postgres JWT_SECRET=secret_jwt + + +OAUTH_REDIRECT_BASE=https://api-staging.panora.dev +ENCRYPT_CRYPTO_SECRET_KEY=selfhosted123 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e8ec584d8..9db366170 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,3 +27,12 @@ services: - 3000:3000 depends_on: - postgres + + webapp: + build: ./packages/webapp + restart: + unless-stopped + ports: + - 1312:8080 + depends_on: + - postgres diff --git a/packages/webapp/.dockerignore b/packages/webapp/.dockerignore new file mode 100644 index 000000000..76add878f --- /dev/null +++ b/packages/webapp/.dockerignore @@ -0,0 +1,2 @@ +node_modules +dist \ No newline at end of file diff --git a/packages/webapp/Dockerfile b/packages/webapp/Dockerfile new file mode 100644 index 000000000..41ea6cd16 --- /dev/null +++ b/packages/webapp/Dockerfile @@ -0,0 +1,14 @@ +# build stage +FROM node:20-alpine as build-stage +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +# production stage +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist/ /usr/share/nginx/html +RUN ls -la /usr/share/nginx/html +EXPOSE 8080 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file