Skip to content

Commit

Permalink
build: do not build in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ddecrulle committed Dec 4, 2023
1 parent 6cd05cb commit 51d9fb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
with:
name: dist
path: dist
- run: tar -cvf build.tar ./dist
- name: Computing Docker image tags
id: step1
env:
Expand Down
18 changes: 3 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
# Build environment
FROM node:20-alpine AS build
WORKDIR /app
COPY package.json yarn.lock .env ./
COPY public ./public
COPY index.html ./
RUN yarn install --frozen-lockfile --network-timeout 600000
COPY tsconfig.json .prettierrc vite.config.js ./
COPY scripts ./scripts
COPY src ./src
RUN yarn build
COPY nginx.conf ./

# Production Env
FROM nginx:stable-alpine
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
WORKDIR /usr/share/nginx/html

# Add bash
RUN apk add --no-cache bash

## Copy .env file and shell script to container
COPY --from=build /app/dist ./
COPY --from=build /app/entrypoint.sh /
ADD dist /usr/share/nginx/html
COPY entrypoint.sh /

## Make shell script executable and prevent windows encoding
RUN sed -i -e 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
Expand Down

0 comments on commit 51d9fb0

Please sign in to comment.