Skip to content

Commit

Permalink
127 feature docker compose only deployment (#157)
Browse files Browse the repository at this point in the history
* Add tags to ignore. (commit message: "Ignore tags")

* 🎉 feat(frontend): add Dockerfile and docker-compose.yml for frontend

* Refactor frontend Dockerfile
  • Loading branch information
lovejavaee authored May 11, 2023
1 parent c89575f commit 12a65eb
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ delete.bat
.Rhistory
model/build/Mask*
model/build/taco*
tags
34 changes: 34 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/engine/reference/builder/#dockerignore-file

**/.DS_Store
**/__pycache__
**/.venv
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
32 changes: 32 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Dockerfile for trash-ai frontend

# Stage 1: Build the project
FROM node:16.12.0 as builder

# Set the working directory
WORKDIR /app

# Copy the package.json and yarn.lock files
COPY package.json yarn.lock ./

# Install dependencies
RUN yarn install

# Copy the rest of the project files
COPY . .

# Build the project
RUN yarn build

# Stage 2: Serve the built project with Nginx
FROM nginx:1.23.3

# Copy the built project from the previous stage
COPY --from=builder /app/dist /usr/share/nginx/html

# Expose port 80
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]

6 changes: 6 additions & 0 deletions frontend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'
services:
frontend:
build: .
ports:
- "8080:80"

0 comments on commit 12a65eb

Please sign in to comment.