diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e104fa5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +dist +.git +.vscode +.DS_Store diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml new file mode 100644 index 0000000..d657a63 --- /dev/null +++ b/.gitea/workflows/docker-build.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..de2b969 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Stage 1: Build the Vue application +FROM node:lts-alpine as build-stage + +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build + +# Stage 2: Serve the application with Nginx +FROM nginx:stable-alpine as production-stage + +COPY --from=build-stage /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..7bf2426 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' +services: + geo-words: + build: . + ports: + - "3002:80" + restart: always + networks: + - npm_public + +networks: + npm_public: + external: true diff --git a/index.html b/index.html index bd63f78..c335d4b 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@
- +