This commit is contained in:
Cat /dev/Nulo 2024-09-14 12:48:45 -03:00
parent 42559cc6b6
commit 5faedf6ebe
7 changed files with 77 additions and 2 deletions

15
sepa/.dockerignore Normal file
View file

@ -0,0 +1,15 @@
node_modules
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
Makefile
helm-charts
.env
.editorconfig
.idea
coverage*

58
sepa/Dockerfile Normal file
View file

@ -0,0 +1,58 @@
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1.1 as base
WORKDIR /usr/src/app
# install dependencies into temp directory
# this will cache them and speed up future builds
# FROM base AS install
# RUN mkdir -p /temp/dev
# COPY package.json bun.lockb /temp/dev/
# COPY sitio2/package.json /temp/dev/sitio2/
# RUN cd /temp/dev/sitio2 && bun install --frozen-lockfile
# # install with --production (exclude devDependencies)
# RUN mkdir -p /temp/prod
# COPY package.json bun.lockb /temp/prod/
# COPY sitio2/package.json /temp/prod/sitio2/
# RUN cd /temp/prod/sitio2 && bun install --frozen-lockfile --production
# copy node_modules from temp directory
# # then copy all (non-ignored) project files into the image
# FROM base AS prerelease
# # COPY --from=install /temp/dev/node_modules node_modules
# COPY . .
# COPY db/schema.ts sitio2/src/lib/server/db/schema.ts
# RUN cd sitio2 && bun install --frozen-lockfile
# ARG DATABASE_URL
# # [optional] tests & build
# ENV NODE_ENV=production
# ENV DATABASE_URL=$DATABASE_URL
# # RUN bun test
# RUN cd sitio2 && bun --bun run build
# copy production dependencies and source code into final image
FROM base AS release
# COPY --from=prerelease /usr/src/app/node_modules node_modules
# COPY --from=prerelease /usr/src/app/sitio2/build .
COPY sitio2/build .
RUN bun install --frozen-lockfile
ARG DATABASE_URL
ARG PORT=3000
ENV DATABASE_URL=$DATABASE_URL
ENV PROTOCOL_HEADER=x-forwarded-proto
ENV HOST_HEADER=x-forwarded-host
ENV PORT=$PORT
# run the app
USER bun
EXPOSE $PORT/tcp
ENTRYPOINT [ "bun", "--bun", "run", "index.js" ]

Binary file not shown.

View file

@ -1,2 +1,2 @@
# Replace with your DB credentials! # Replace with your DB credentials!
DATABASE_URL="postgres://user:password@host:port/db-name" DATABASE_URL="postgres://user:password@host:5432/db-name"

Binary file not shown.

View file

@ -32,6 +32,7 @@
"prettier-plugin-svelte": "^3.2.5", "prettier-plugin-svelte": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.6.5", "prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0-next.1", "svelte": "^5.0.0-next.1",
"svelte-adapter-bun": "^0.5.2",
"svelte-check": "^3.6.0", "svelte-check": "^3.6.0",
"tailwindcss": "^3.4.9", "tailwindcss": "^3.4.9",
"typescript": "^5.0.0", "typescript": "^5.0.0",

View file

@ -1,4 +1,5 @@
import adapter from '@sveltejs/adapter-auto'; // import adapter from '@sveltejs/adapter-auto';
import adapter from 'svelte-adapter-bun';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */