Skip to content

Commit

Permalink
Fix deployment I think
Browse files Browse the repository at this point in the history
  • Loading branch information
nroh555 committed Jul 9, 2024
1 parent 120fccf commit faff83f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: npm test
on:
pull_request:
branches:
- '**'
- "**"

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
Expand All @@ -16,9 +16,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
node-version-file: ".nvmrc"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
- name: Install dependencies
run: yarn
- name: Run build
Expand Down
18 changes: 11 additions & 7 deletions web/Dockerfile.production
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
# syntax = docker/dockerfile:1

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=18.19.0
ARG NODE_VERSION=18
FROM node:${NODE_VERSION}-slim as base

LABEL fly_launch_runtime="Vite"

# Vite app lives here
WORKDIR /app

ARG YARN_VERSION=1.22.19
ARG YARN_VERSION=1.22.22
RUN npm install -g yarn@$YARN_VERSION --force


# 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 Yarn configuration files
COPY .yarnrc.yml ./
COPY .yarn/ ./.yarn/

# Install node modules
COPY --link package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production=false
RUN yarn install --frozen-lockfile

# Copy application code
COPY --link . .

# Verify all files are copied
RUN ls -la /app

# Set build time environment variables
ENV VITE_API_URL="https://wdcc-fsae-jobs-board-api.fly.dev"

# Build application
RUN yarn run build

# Remove development dependencies
RUN yarn install --production=true

RUN yarn workspaces focus --production

# Final stage for app image
FROM nginx
Expand All @@ -45,7 +50,6 @@ COPY --from=build /app/dist /usr/share/nginx/html
COPY --link _redirects /usr/share/nginx/html/_redirects
COPY nginx.conf /etc/nginx/nginx.conf


# Start the server by default, this can be overwritten at runtime
EXPOSE 80
CMD [ "/usr/sbin/nginx", "-g", "daemon off;" ]
17 changes: 11 additions & 6 deletions web/Dockerfile.staging
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
# syntax = docker/dockerfile:1

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=18.19.0
ARG NODE_VERSION=18
FROM node:${NODE_VERSION}-slim as base

LABEL fly_launch_runtime="Vite"

# Vite app lives here
WORKDIR /app

ARG YARN_VERSION=1.22.19
ARG YARN_VERSION=1.22.22
RUN npm install -g yarn@$YARN_VERSION --force


# 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 Yarn configuration files
COPY .yarnrc.yml ./
COPY .yarn/ ./.yarn/

# Install node modules
COPY --link package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production=false
RUN yarn install --frozen-lockfile

# Copy application code
COPY --link . .

# Verify all files are copied
RUN ls -la /app

# Set build time environment variables
ENV VITE_API_URL="https://wdcc-fsae-jobs-board-api-staging.fly.dev"

# Build application
RUN yarn run build

# Remove development dependencies
RUN yarn install --production=true

RUN yarn workspaces focus --production

# Final stage for app image
FROM nginx
Expand Down

0 comments on commit faff83f

Please sign in to comment.