Merge pull request #53 from aimingmed/feature/backend-frontend-structure

update frontend docker build
This commit is contained in:
Hong Kai LEE 2025-04-15 18:28:08 +08:00 committed by GitHub
commit 91cab4333c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 1 deletions

View File

@ -25,7 +25,7 @@ services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.local
dockerfile: Dockerfile.test
container_name: frontend
volumes:
- ./frontend:/usr/src/app

1
app/frontend/.env.test Normal file
View File

@ -0,0 +1 @@
REACT_APP_BASE_DOMAIN_NAME=localhost

View File

@ -0,0 +1,18 @@
####### BUILDER IMAGE #######
# Build stage
FROM node:alpine
WORKDIR /usr/src/app
# Copy everything else, test and build
COPY . /usr/src/app
# Build the app with a specific .env file
ARG ENV_FILE=.env.test
COPY ${ENV_FILE} /usr/src/app/.env
# Copy dependency files and install dependencies
RUN npm install && npm i --save-dev @types/jest
EXPOSE 5173
CMD [ "npm", "run", "dev" ]