Skip to content

Commit cb07066

Browse files
committed
Docker関係の設定の変更
1 parent 38b113f commit cb07066

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.nuxt/

Dockerfile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
FROM node:10.19-alpine
1+
FROM node:12.18.1-alpine
22

3-
ENV PROJECT_ROOTDIR /app/
4-
5-
WORKDIR $PROJECT_ROOTDIR
3+
ENV HOST 0.0.0.0
64

7-
COPY package.json yarn.lock $PROJECT_ROOTDIR
5+
RUN mkdir -p /app
6+
COPY . /app
7+
WORKDIR /app
88

9-
RUN set -x && \
10-
yarn install
9+
ARG ENV
10+
ENV ENV $ENV
1111

12-
COPY . $PROJECT_ROOTDIR
12+
RUN yarn && yarn build
1313

1414
EXPOSE 3000
15-
ENV HOST 0.0.0.0
16-
17-
CMD ["yarn", "dev"]
1815

16+
CMD ["yarn", "start"]

docker-compose.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
version: "3"
1+
version: "3.7"
22
services:
3-
app:
4-
container_name: studyathome
5-
build:
6-
context: .
7-
dockerfile: Dockerfile
8-
tty: true
3+
studyathome:
4+
build: .
5+
command: yarn install & yarn dev
96
ports:
107
- 3000:3000
118
volumes:
129
- .:/app
13-
- node_modules:/app/node_modules
14-
volumes:
15-
node_modules: {}
1610

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"author": "Nekoya3",
66
"private": true,
77
"scripts": {
8-
"dev": "cross-env NODE_ENV=development nuxt-ts",
8+
"dev": "cross-env HOST=0.0.0.0 PORT=3000 NODE_ENV=development nuxt-ts",
99
"build": "yarn prebuild && nuxt-ts build",
1010
"prebuild": "cross-env NODE_ENV=development node pre_build_script/swEnvBuild.js",
1111
"test:unit": "jest --config jest.config.js",
12-
"start": "cross-env NODE_ENV=production nuxt-ts",
12+
"start": "cross-env NODE_ENV=production HOST=0.0.0.0 PORT=3000 nuxt-ts",
1313
"generate": "nuxt-ts generate",
1414
"lint": "eslint --ext .js,.vue,.ts --ignore-path .eslintignore .",
1515
"clean": "rimraf .nuxt dist",

0 commit comments

Comments
 (0)