-
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update preview deploy config (#3951)
- Loading branch information
Showing
2 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |