Skip to content

Commit

Permalink
Merge pull request #23 from striderkein/feat/#11
Browse files Browse the repository at this point in the history
feat:Dockerize
  • Loading branch information
striderkein committed Sep 25, 2023
2 parents a65c659 + 1918b07 commit 4ce680f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REACT_APP_API_HOST=http://localhost
REACT_APP_API_PORT=3000
REACT_APP_API_PORT=3001
REACT_APP_WEB_PORT=3000
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ベースイメージを指定
# node:18 だと OpenSSL のエラーが解消できなかったので node:16 を使用
FROM node:16

# OpenSSLをインストール
RUN apt-get update && apt-get install -y openssl

# OpenSSL の設定ファイルを指定
ENV OPENSSL_CONF=/etc/ssl/

# 作業ディレクトリを指定
WORKDIR /app

# 依存関係をインストール
COPY package*.json ./
RUN npm cache clean --force
RUN npm install

# ソースコードをコピー
COPY . .

# ビルド
RUN npm run build

# ポートを公開
# EXPOSE 3000

# コンテナ起動時に実行するコマンドを指定
CMD [ "npm", "start" ]

# CA 証明書を更新
RUN update-ca-certificates
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'

services:
app:
build: .
container_name: eaglys-web
ports:
- "${REACT_APP_WEB_PORT}:3000"
volumes:
- .:/app
environment:
- NODE_ENV=development
networks:
- eaglys
networks:
eaglys:
driver: bridge

0 comments on commit 4ce680f

Please sign in to comment.