Skip to content

Commit

Permalink
feat: update preview deploy config (#3951)
Browse files Browse the repository at this point in the history
  • Loading branch information
iSCJT authored Oct 24, 2024
1 parent 0cdd649 commit 20c55cb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
47 changes: 47 additions & 0 deletions Dockerfile.preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# syntax = docker/dockerfile:1

FROM node:20-slim AS base

LABEL fly_launch_runtime="Remix"

# Remix app lives here
WORKDIR /app

# Set production environment
ENV NODE_ENV="production"
ARG YARN_VERSION=3.6.4

# Install Yarn 3
RUN corepack enable && \
yarn set version ${YARN_VERSION}

# Throw-away build stage to reduce size of final image
FROM base AS build

# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3

# Copy source code
COPY . .

# Install packages
RUN yarn install

RUN echo "VITE_GA_TRACKING_ID=\"G-G4QQ9NSQPC\"" >> .env && \
echo "VITE_PATREON_CLIENT_ID=\"RLgZo7SKNVn8cOyFlYeGZsNnoCOjvzQiNJFskDfoxltZltjPPGNMPokwJckHNphU\"" >> .env && \
echo "VITE_PLATFORM_THEME=\"precious-plastic\"" >> .env

# Build application
RUN yarn run build

# Final stage for app image
FROM base

# Copy built application
COPY --from=build /app /app

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD [ "yarn", "run", "start" ]

10 changes: 9 additions & 1 deletion fly-preview.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
primary_region = 'cdg'

[build]
dockerfile = "Dockerfile.preview"

[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = 'off'
auto_stop_machines = 'stop'
processes = ['app']

[env]
VITE_BRANCH = "preview"

[[vm]]
memory = '4gb'
cpu_kind = 'shared'
cpus = 1

0 comments on commit 20c55cb

Please sign in to comment.