-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from acmutd/internal/docker
Internal/docker
- Loading branch information
Showing
8 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.github | ||
.idea | ||
build/ | ||
node_modules/ | ||
/node_modules | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Publish Docker image | ||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
pull_request: | ||
branches: [dev] | ||
|
||
jobs: | ||
push_to_registries: | ||
name: Push Docker Image to DockerHub and Github Packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
- name: Push to Docker Hub | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
repository: acmutd/portal | ||
tag_with_ref: true | ||
- name: Push to GitHub Packages | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: docker.pkg.github.com | ||
repository: acmutd/portal/portal | ||
tag_with_ref: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
worker_processes 4; | ||
|
||
events { worker_connections 1024; } | ||
|
||
http { | ||
server { | ||
listen 3000; | ||
root /usr/share/nginx/html; | ||
include /etc/nginx/mime.types; | ||
|
||
location /appui { | ||
try_files $uri /index.html; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# stage1 as builder | ||
FROM node:alpine as builder | ||
|
||
# copy the package.json to install dependencies | ||
COPY package.json package-lock.json ./ | ||
|
||
# Install the dependencies and make the folder | ||
RUN npm install && mkdir /react-ui && mv ./node_modules ./react-ui | ||
|
||
WORKDIR /react-ui | ||
|
||
COPY . . | ||
|
||
# Build the project and copy the files | ||
RUN npm run build | ||
|
||
|
||
FROM nginx:alpine | ||
|
||
#!/bin/sh | ||
|
||
COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf | ||
|
||
## Remove default nginx index page | ||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
# Copy from the stahg 1 | ||
COPY --from=builder /react-ui/build /usr/share/nginx/html | ||
|
||
EXPOSE 3000 3000 | ||
|
||
ENTRYPOINT ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json /app | ||
|
||
RUN npm install | ||
|
||
COPY . /app | ||
|
||
CMD ["npm", "run", "dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: "3.8" | ||
services: | ||
client: | ||
stdin_open: true | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- "/app/node_modules" | ||
- "./:/app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: "3.8" | ||
services: | ||
portal: | ||
stdin_open: true | ||
image: acmutd/portal:latest | ||
ports: | ||
- "3000:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!bin/bash | ||
|
||
npm start |