Skip to content

Commit

Permalink
Merge pull request #86 from kookmin-sw/BE_Feature/#58-docker
Browse files Browse the repository at this point in the history
docker
  • Loading branch information
wjdwlghks authored May 18, 2024
2 parents 7b39399 + 539b69d commit ef9b0ee
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
3 changes: 2 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
.env

### STS ###
.apt_generated
Expand All @@ -26,7 +27,7 @@ bin/
out/
!**/src/main/**/out/
!**/src/test/**/out/

.env
### NetBeans ###
/nbproject/private/
/nbbuild/
Expand Down
15 changes: 15 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM eclipse-temurin:17-jdk-alpine as builder
WORKDIR /workspace/app
COPY ./ ./

RUN --mount=type=cache,target=/root/.gradle ./gradlew clean bootJar
RUN mkdir build/extracted && (java -Djarmode=layertools -jar build/libs/*.jar extract --destination build/extracted)

FROM eclipse-temurin:17-jdk-alpine
VOLUME /tmp
ARG EXTRACTED=/workspace/app/build/extracted
COPY --from=builder ${EXTRACTED}/dependencies/ ./
COPY --from=builder ${EXTRACTED}/spring-boot-loader/ ./
COPY --from=builder ${EXTRACTED}/snapshot-dependencies/ ./
COPY --from=builder ${EXTRACTED}/application/ ./
ENTRYPOINT ["java","org.springframework.boot.loader.JarLauncher"]
4 changes: 4 additions & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ repositories {
mavenCentral()
}

bootJar {
loaderImplementation = org.springframework.boot.loader.tools.LoaderImplementation.CLASSIC
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,4 @@ public class Post {
@JsonBackReference
@ManyToOne
private Club club;


}
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3.8'
services:
spring:
container_name: spring
restart: "no"
image: spring
env_file:
- .env
ports:
- 8080:8080

fastapi:
container_name: fastapi
restart: "no"
image: fastapi
env_file:
- .env
ports:
- 8000:8000
11 changes: 11 additions & 0 deletions fastapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.9

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

COPY ./main.py /code/

CMD ["fastapi", "run", "main.py", "--port", "80"]
117 changes: 117 additions & 0 deletions fastapi/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
annotated-types==0.6.0
anyio==4.3.0
apturl==0.5.2
attrs==21.2.0
bcrypt==3.2.0
blinker==1.4
Brlapi==0.8.3
certifi==2020.6.20
chardet==4.0.0
click==8.0.3
colorama==0.4.4
command-not-found==0.3
cryptography==3.4.8
cupshelpers==1.0
dbus-python==1.2.18
defer==1.0.6
distro==1.7.0
distro-info===1.1build1
dnspython==2.6.1
docker==5.0.3
docker-compose==1.29.2
dockerpty==0.4.1
docopt==0.6.2
duplicity==0.8.21
email_validator==2.1.1
exceptiongroup==1.2.1
fastapi==0.111.0
fastapi-cli==0.0.3
fasteners==0.14.1
future==0.18.2
gyp==0.1
h11==0.14.0
httpcore==1.0.5
httplib2==0.20.2
httptools==0.6.1
httpx==0.27.0
idna==3.3
importlib-metadata==4.6.4
jeepney==0.7.1
Jinja2==3.1.4
jsonschema==3.2.0
keyring==23.5.0
language-selector==0.1
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
lockfile==0.12.2
louis==3.20.0
macaroonbakery==1.3.1
Mako==1.1.3
markdown-it-py==3.0.0
MarkupSafe==2.0.1
mdurl==0.1.2
monotonic==1.6
more-itertools==8.10.0
netifaces==0.11.0
numpy==1.26.4
oauthlib==3.2.0
olefile==0.46
openai==1.30.1
orjson==3.10.3
paramiko==2.9.3
pexpect==4.8.0
Pillow==9.0.1
pinecone==4.0.0
protobuf==3.12.4
ptyprocess==0.7.0
pycairo==1.20.1
pycups==2.0.1
pydantic==2.7.1
pydantic_core==2.18.2
Pygments==2.18.0
PyGObject==3.42.1
PyJWT==2.3.0
pymacaroons==0.13.0
PyNaCl==1.5.0
pyparsing==2.4.7
pyRFC3339==1.1
pyrsistent==0.18.1
python-apt==2.4.0+ubuntu1
python-dateutil==2.8.1
python-debian===0.1.43ubuntu1
python-dotenv==0.19.2
python-multipart==0.0.9
pytz==2022.1
pyxdg==0.27
PyYAML==5.4.1
reportlab==3.6.8
requests==2.25.1
rich==13.7.1
SecretStorage==3.3.1
shellingham==1.5.4
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
starlette==0.37.2
systemd-python==234
texttable==1.6.4
tqdm==4.66.4
typer==0.12.3
typing_extensions==4.11.0
ubuntu-advantage-tools==8001
ubuntu-drivers-common==0.0.0
ufw==0.36.1
ujson==5.10.0
unattended-upgrades==0.1
urllib3==1.26.5
usb-creator==0.3.7
uvicorn==0.29.0
uvloop==0.19.0
wadllib==1.3.6
watchfiles==0.21.0
websocket-client==1.2.3
websockets==12.0
xdg==5
xkit==0.0.0
zipp==1.0.0

0 comments on commit ef9b0ee

Please sign in to comment.