-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat:Dockerize
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |