Skip to content

Commit

Permalink
building a container
Browse files Browse the repository at this point in the history
  • Loading branch information
venil7 committed Jul 6, 2024
1 parent e3b5323 commit 60f4fa3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build_docker_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "build feature branch"
on: [ push ]
jobs:
"Build_Docker_Container":
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build container
run: docker buildx build -t react-open-arch .
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:20-alpine as builder

WORKDIR /app

COPY . .

RUN ["npm", "ci"]
RUN ["npm", "run", "build"]

FROM nginx:stable as nginx
WORKDIR /app
COPY --from=builder /app/dist ./static/
COPY ./nginx.conf /etc/nginx/nginx.conf

EXPOSE 8080

CMD ["nginx", "-g", "daemon off;"]
22 changes: 22 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
events {
worker_connections 1024;
}

http {
include mime.types;
sendfile on;

server {
listen 8080;
listen [::]:8080;

resolver 127.0.0.11;
autoindex off;

server_name _;
server_tokens off;

root /app/static;
gzip_static on;
}
}

0 comments on commit 60f4fa3

Please sign in to comment.