Skip to content

Commit

Permalink
Added default port (80)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDyakonov committed Aug 4, 2024
1 parent 58adbf8 commit a10747c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ RUN yarn build

FROM nginx:stable-alpine as production-stage

ARG NGINX_PORT=3000

ENV NGINX_PORT ${NGINX_PORT}

COPY --from=build-stage /app/dist /usr/share/nginx/html

COPY nginx.conf /tmp/nginx.conf
COPY nginx.conf /etc/nginx/nginx.conf

RUN sed "s|%NGINX_PORT%|${NGINX_PORT}|g" /tmp/nginx.conf > /etc/nginx/nginx.conf
EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Vue 3 + TypeScript + Vite
## Landing DishDash

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
По умолчанию при билде с помощью `Dockerfile` фронтенд запускается на `:80` порту.

## Recommended Setup
Пример `docker-compose.yml`:
```
version: '3.8'
- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously Volar) and disable Vetur

- Use [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) for performing the same type checking from the command line, or for generating d.ts files for SFCs.
services:
frontend:
ports:
- ${NGINX_PORT-3000}:80
build:
context: .
dockerfile: Dockerfile
```
8 changes: 2 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ version: '3.8'
services:
frontend:
ports:
- ${NGINX_PORT-3000}:${NGINX_PORT-3000}
- ${NGINX_PORT-3000}:80
build:
context: .
dockerfile: Dockerfile
args:
NGINX_PORT: ${NGINX_PORT:-3000}
environment:
- NGINX_PORT=${NGINX_PORT-3000}
dockerfile: Dockerfile
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ http {
}

server {
listen %NGINX_PORT%;
listen 80;
server_name localhost;

location / {
Expand Down

0 comments on commit a10747c

Please sign in to comment.