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 @@ - + Rubic Cube diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..40b9650 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/src/App.vue b/src/App.vue index adc6a87..0f4dbca 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,9 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/vue.svg b/src/assets/vue.svg deleted file mode 100644 index 770e9d3..0000000 --- a/src/assets/vue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index f162510..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/src/components/main.vue b/src/components/main.vue new file mode 100644 index 0000000..0ff0594 --- /dev/null +++ b/src/components/main.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/vite.config.js b/vite.config.js index bbcf80c..a812801 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,4 +4,13 @@ import vue from '@vitejs/plugin-vue' // https://vite.dev/config/ export default defineConfig({ plugins: [vue()], + server: { + port: 5174, + hmr: { + overlay: true, + }, + watch: { + usePolling: true, + }, + }, })