Skip to content

Commit

Permalink
update installtion
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhoubk committed Nov 26, 2024
1 parent 08a1633 commit e9351c5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN apt-get update -qq
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
curl \
gpg \
default-jre \
ca-certificates \
libpq-dev \
Expand All @@ -36,12 +37,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

# Install Node.js (using NodeSource to get the latest LTS version, e.g., 20.x)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x| bash - && \
apt-get install -y nodejs
apt-get install -y --no-install-recommends nodejs

# Install Yarn (using the official Yarn repository)
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y yarn
apt-get update && apt-get install -y --no-install-recommends yarn

# By default, run as the geodata user
USER geodata
Expand All @@ -50,7 +51,7 @@ USER geodata
WORKDIR /opt/app

# Add binstubs to the path.
ENV PATH "/opt/app/bin:$PATH"
ENV PATH="/opt/app/bin:$PATH"


# If run with no other arguments, the image will start the rails server by
Expand Down Expand Up @@ -89,7 +90,9 @@ COPY --chown=geodata . .
RUN bundle exec -- rails log:clear tmp:create \
&& rails assets:precompile

RUN mkdir tmp/cache/downloads

# RUN npx vite build --debug
# RUN mkdir tmp/cache/downloads

# ============================================================================
# Target: production
Expand Down
39 changes: 32 additions & 7 deletions vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
import { defineConfig } from 'vite'
import rails from 'vite-plugin-rails'
// import { defineConfig } from 'vite'
// import rails from 'vite-plugin-rails'

export default defineConfig({
plugins: [
rails(),
]
})
// export default defineConfig({
// plugins: [
// rails(),
// ]
// })

import { defineConfig, searchForWorkspaceRoot } from "vite";
import rails from "vite-plugin-rails";

export default defineConfig(({ mode }) => {
return {
build: {
minify: mode === "production",
manifest: true,
sourcemap: true,
outDir: 'dist',
},
server: {
fs: {
allow: [
// search up for workspace root
searchForWorkspaceRoot(process.cwd()),
// One directory up (from .internal_test_app where we do `yarn link @geoblacklight`)
`${process.cwd()}/..`,
],
},
},
plugins: [rails()],
};
});

0 comments on commit e9351c5

Please sign in to comment.