diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..80faac2 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,30 @@ +name: Build and Publish Docker Image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Gitea Registry + uses: docker/login-action@v2 + with: + registry: gitea.7u.pl + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: gitea.7u.pl/gkucmierz/rubic-cube:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6e1e6a0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Build stage +FROM node:18-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build + +# Production stage +FROM nginx:stable-alpine + +COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..61e3fe0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.8' + +services: + rubic-cube: + image: gitea.7u.pl/gkucmierz/rubic-cube:latest + container_name: rubic-cube + restart: always + ports: + - "8083:80" + networks: + - rubic-net + +networks: + rubic-net: + driver: bridge diff --git a/index.html b/index.html index 8a14c80..400c43c 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@
- +